日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 人文社科 > 生活经验 >内容正文

生活经验

Jenkins 插件 地址证书报错问题解决思路

發(fā)布時(shí)間:2023/11/27 生活经验 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Jenkins 插件 地址证书报错问题解决思路 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

問題提示摘要:

SunCertPathBuilderException: unable to find valid certification path to requested target
......

網(wǎng)上很多的解決方式是更新站點(diǎn)的地址,我這里修改了一個(gè)日本的地址(清華鏡像也好),其實(shí)發(fā)現(xiàn)是解決不了上述的報(bào)錯(cuò)問題的,其實(shí),最終拉去插件的時(shí)候,會(huì)提示證書的問題,幾經(jīng)周折找到了其中一遍博文的方案,經(jīng)實(shí)踐是可行的,實(shí)踐出真知。
之前我一直停留在 https 改成 http 的認(rèn)知,但其實(shí)當(dāng)你細(xì)心的看報(bào)錯(cuò)信息,其實(shí)提示的是證書問題。于是帶著問題去找方案就好辦了,感謝下屬方案的博主分享。

解決方案:
配置Java SSL 訪問網(wǎng)站證書

最近在開發(fā) Java 訪問 Azure ServiceBus 時(shí)遇到SSL證書問題,導(dǎo)致JAVA報(bào)錯(cuò),不能正常訪問,報(bào)錯(cuò)信息如下:

javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

解決方法:配置要訪問網(wǎng)站的域名證書,并導(dǎo)入的服務(wù)器jdk環(huán)境中

  1. 從https://github.com/escline/InstallCert下載InstallCert.java
  2. 編譯javac InstallCert.java
  3. 運(yùn)行InstallCert,參數(shù)是你調(diào)用的網(wǎng)址(Azure事件中心的地址),如果是80端口可以省略port
java InstallCert [host]:[port]例:java InstallCert abc.com:443

  運(yùn)行后會(huì)列出證書讓你選擇,輸入1回車,最后會(huì)在當(dāng)前目錄生成一個(gè)jssecacerts文件。

1. 導(dǎo)出證書文件

1)???? 使用CMD命令進(jìn)入jssecacerts文件所在目錄

2)???? 運(yùn)行以下命令,導(dǎo)出證書文件:

keytool -exportcert -alias [host]-1 -keystore jssecacerts -storepass changeit -file [host].cer例:keytool -exportcert -alias www.abc.com-1 -keystore jssecacerts -storepass changeit -file www.abc.com.cer<br>

將證書文件導(dǎo)入系統(tǒng)keystore

keytool -importcert -alias [host] -keystore [path to system keystore] -storepass changeit -file [host].cer例:keytool -importcert -alias www.abc.com -keystore "C:\Program Files\Java\jre1.8.0_111\lib\security\cacerts" -storepass changeit -file www.abc.com.cer

?

# Example:java InstallCert woot.com:443Loading KeyStore /usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/security/cacerts...Opening connection to woot.com:443...Starting SSL handshake...javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target<...>Server sent 1 certificate(s):1 Subject O=Woot Inc, C=US, ST=Texas, L=Carrollton, CN=*.woot.comIssuer? CN=SecureTrust CA, O=SecureTrust Corporation, C=USsha1??? 4b 46 ca 6b 83 05 b3 51 ff c6 e7 9c fd b3 9b e3 3f 2e c4 53md5???? e8 a5 88 1b d5 67 bb fc 88 cc b1 c5 2b ac c4 7dEnter certificate to add to trusted keystore or 'q' to quit: [1][enter][[Version: V3Subject: O=Woot Inc, C=US, ST=Texas, L=Carrollton, CN=*.woot.comSignature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5<...>Added certificate to keystore 'jssecacerts' using alias 'woot.com-1'keytool -exportcert -alias woot.com-1 -keystore jssecacerts -storepass changeit -file woot.com.cerCertificate stored in file <woot.com.cer>(sudo) keytool -importcert -alias woot.com -keystore /usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/security/cacerts -storepass changeit -file woot.com.cerOwner: O=Woot Inc, C=US, ST=Texas, L=Carrollton, CN=*.woot.comIssuer: CN=SecureTrust CA, O=SecureTrust Corporation, C=US<...>Trust this certificate? [no]:yesCertificate was added to keystore

  

修改默認(rèn)Jenkins插件源與連接檢測(cè)位置(加速)

$ sed -i 's/http:\/\/updates.jenkins.io\/download/https:\/\/mirrors.tuna.tsinghua.edu.cn\/jenkins/g' /home/jenkins/root/updates/default.json
$ sed -i 's/http:\/\/www.google.com/https:\/\/www.baidu.com/g' /home/jenkins/root/updates/default.json

修改為清華鏡像的文件下載:https://download.csdn.net/download/u013490585/12831832?

附件:https://github.com/mwanlyc/InstallCert
參考地址:https://www.cnblogs.com/oceanwang/p/6229789.html

總結(jié)

以上是生活随笔為你收集整理的Jenkins 插件 地址证书报错问题解决思路的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。