问题提示摘要:

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

网上很多的解决方式是更新站点的地址,我这里修改了一个日本的地址(清华镜像也好),其实发现是解决不了上述的报错问题的,其实,最终拉去插件的时候,会提示证书的问题,几经周折找到了其中一遍博文的方案,经实践是可行的,实践出真知。
之前我一直停留在 https 改成 http 的认知,但其实当你细心的看报错信息,其实提示的是证书问题。于是带着问题去找方案就好办了,感谢下属方案的博主分享。

解决方案:
配置Java SSL 访问网站证书

最近在开发 Java 访问 Azure ServiceBus 时遇到SSL证书问题,导致JAVA报错,不能正常访问,报错信息如下:

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

解决方法:配置要访问网站的域名证书,并导入的服务器jdk环境中

  1. 从https://github.com/escline/InstallCert下载InstallCert.java
  2. 编译javac InstallCert.java
  3. 运行InstallCert,参数是你调用的网址(Azure事件中心的地址),如果是80端口可以省略port
java InstallCert [host]:[port]例:java InstallCert abc.com:443

  运行后会列出证书让你选择,输入1回车,最后会在当前目录生成一个jssecacerts文件。

1. 导出证书文件

1)     使用CMD命令进入jssecacerts文件所在目录

2)     运行以下命令,导出证书文件:

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>

将证书文件导入系统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

  

修改默认Jenkins插件源与连接检测位置(加速)

$ 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

Jenkins 插件 地址证书报错问题解决思路相关推荐

  1. jenkins ssl证书报错问题解决

    Jenkins 是一款流行的开源持续集成工具用于项目开发,具有自动化构建.测试和部署等功能. 可以.war的方式来运行Jenkins: 从Jenkins下载jenkins.war. 在目录下运行:ja ...

  2. Jenkins邮件通知配置报错问题解决

    在Jenkins系统管理-->系统配置中配置邮件通知的时候Test configuration时报错:com.sun.mail.smtp.SMTPSenderFailedException: 5 ...

  3. centos6.4安装apache php mysql_CentOS 6.4配置Apache+PHP5+MySQL(lamp)环境以及报错处理思路...

    CentOS 6.4配置Apache+PHP5+MySQL(lamp)环境以及报错处理思路 2015-07-14 13:06:12来源: 阅读 () Centos是linux下的一款系统了,下面我来介 ...

  4. ionic xcode 上传appstroe 创建Distribution证书报错 you already have a current iOS Distribution certificate

    ionic xcode 上传appstroe 创建Distribution证书报错 you already have a current iOS Distribution certificate 报错 ...

  5. VS +QT 手动添加Q_OBJECT 报错问题解决

    VS+QT 手动添加Q_OBJECT 报错问题解决 参考QT Ide上,需要重新Qmake 在vs上,手动添加Q_OBJECT,后moc_XXX文件也生成,但是编译却失败,出现无法打开moc_xxx ...

  6. 高德地图点聚合插件AMap.MarkerClusterer报错Uncaught TypeError: Cannot read properties of null (reading ‘Md‘)

    报错信息:Uncaught TypeError: Cannot read properties of null (reading 'Md') mapscallback=___onAPILoaded&a ...

  7. Node.js 、Newman安装配置及报错问题解决

    Node.js .Newman安装配置及报错问题解决 Node.js 下载: Node.js 安装包及源码下载地址为:https://nodejs.org/en/download/. 你可以根据不同平 ...

  8. django 使用json.dumps转换queryset的datatime报错问题解决

    django 使用json.dumps转换queryset的datatime报错问题解决 参考文章: (1)django 使用json.dumps转换queryset的datatime报错问题解决 ( ...

  9. python3的urllib2报错问题解决方法

    python3的urllib2报错问题解决方法 参考文章: (1)python3的urllib2报错问题解决方法 (2)https://www.cnblogs.com/marsggbo/p/66229 ...

最新文章

  1. 包邮送25本经典书籍,无任何套路!
  2. 缓存穿透、缓存击穿、缓存雪崩及其解决方案
  3. 解析利用wsdl.exe生成webservice代理类的详解
  4. 通过100个单词掌握英语语法(四十四)more
  5. 股市大涨是不是楼市就要跌了?
  6. LoadRunner+Android模所器实现抓包并调试本地服务端
  7. golang实现聊天室(二)
  8. Exynos4412 内核移植(三)—— 内核启动过程分析
  9. table 条数过大优化_MySQL数据库优化的介绍(图文)
  10. 2017年12月20日 内置对象
  11. java视频播放器vlcj_vlcj--java-制作视频播放器
  12. VC6.0新建工程——Win32 Application和Win32 Console Application
  13. 在线小游戏,在线小游戏大全,网页在线小游戏大全
  14. IOS开发之——第一个IOS应用
  15. Html5 Egret游戏开发 成语大挑战(二)干净的eui项目和资源准备
  16. 酬岑勋见寻就元丹丘对酒相待,以诗见招
  17. ISO-8601,日期时间格式表示法的国际标准
  18. 深天马A第一季度净利润为2.89亿元 同比减少35.4%
  19. 二元logistic模型案例_SPSS二项logistic回归分析案例实践,做个预测模型
  20. Python爬虫:url中带字典列表参数的编码转换

热门文章

  1. 2022-2028年中国果壳活性炭行业市场发展调研及竞争战略分析报告
  2. 使用python建立简单的单链表
  3. 经历能让人变得更理智更成熟
  4. debian10 apache2使用ssl
  5. html 实现动态在线预览word、excel、pdf等文件
  6. 机器学习常用术语词汇表
  7. scipy csr_matrix csc_matrix
  8. 通俗理解tf.nn.conv2d() tf.nn.conv3d( )参数的含义 pytorhc 卷积
  9. 主流手机OS与鸿蒙OS
  10. CPU,GPU,Memory调度