1. 程式人生 > >SunCertPathBuilderException: Unable To Find Valid Certification Path To Requested Target

SunCertPathBuilderException: Unable To Find Valid Certification Path To Requested Target

C:\>java InstallCert localhost:8443
Loading KeyStore C:\Program Files\Java\jre6\lib\security\cacerts...
Opening connection to localhost:8443...
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 at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source) at com.sun.net.ssl.internal.ssl.Handshaker
.fatalSE(Unknown Source) at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source) at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Unknown Source) at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown Source) at com.sun.net
.ssl.internal.ssl.Handshaker.processLoop(Unknown Source) at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown Source) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source) at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source) at InstallCert.main(InstallCert.java:87) Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertP athBuilderException: unable to find valid certification path to requested target at sun.security.validator.PKIXValidator.doBuild(Unknown Source) at sun.security.validator.PKIXValidator.engineValidate(Unknown Source) at sun.security.validator.Validator.validate(Unknown Source) at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.validate(Unknown Source) at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source) at InstallCert$SavingTrustManager.checkServerTrusted(InstallCert.java:182) ... 9 more Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to reques ted target at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source) at java.security.cert.CertPathBuilder.build(Unknown Source) ... 15 more   Server sent 1 certificate(s):   1 Subject CN=yong mook kim, OU=mkyong, O=mkyong, L=puchong, ST=PJ, C=my Issuer CN=yong mook kim, OU=mkyong, O=mkyong, L=puchong, ST=PJ, C=my sha1 32 3e 15 42 96 ba e9 4d 9c 5d e7 5e 6b 0f 30 23 b4 e3 f4 98 md5 c8 dd a1 af 9f 55 a0 7f 6e 98 10 de 8c 63 1b a5   Enter certificate to add to trusted keystore or 'q' to quit: [1] 1   [ [ Version: V3 Subject: CN=yong mook kim, OU=mkyong, O=mkyong, L=puchong, ST=PJ, C=my Signature Algorithm: SHA1withRSA, OID = 1.2.840.113549.1.1.5   Key: Sun RSA public key, 1024 bits modulus: 1129473579651954554552730664834664064459539051598864058082387115962631728819634110255367718769683451438528187 923246533854744470790959477657386037636238098777089479256059697784394926741427654735994678054030193662669088404706890444 59364523220747231216704221781747262219695262340353839314222273672957748320603247 public exponent: 65537 Validity: [From: Tue Dec 14 15:13:51 SGT 2010, To: Mon Mar 14 15:13:51 SGT 2011] Issuer: CN=yong mook kim, OU=mkyong, O=mkyong, L=puchong, ST=PJ, C=my SerialNumber: [ 4d07192f]   ] Algorithm: [SHA1withRSA] Signature: 0000: 38 E4 F4 D9 51 B1 5F C1 01 13 32 79 DE 97 26 58 8...Q._...2y..&X 0010: 13 08 F1 A0 33 DB B9 90 AF EE 9E AE B9 9B 68 7D ....3.........h. 0020: DF E8 7D 79 9D 92 24 4A 76 C9 4C 28 DA 68 B0 62 ...y..$Jv.L(.h.b 0030: FF AB 27 03 5C DD 1F C8 77 A2 25 18 DF 0C DC FD ..'.\...w.%..... 0040: D3 39 5D 18 B4 BA 4B 36 8C FD C5 80 FF F2 E3 4D .9]...K6.......M 0050: 0A 28 57 B9 04 D8 25 F6 FB CA DA 13 0C 36 FB 02 .(W...%......6.. 0060: 9A B3 B1 28 46 D1 8E C7 D9 1A 5B CE BB A6 6F FD ...(F.....[...o. 0070: 6D F2 35 D9 95 43 6E 38 2A 56 E7 31 21 D9 F0 90 m.5..Cn8*V.1!...   ]   Added certificate to keystore 'jssecacerts' using alias 'localhost-1'

3. Verify Trusted Keystore

Try run the InstallCert command again, the connection should be ok now.

C:\>java InstallCert localhost:8443
Loading KeyStore jssecacerts...
Opening connection to localhost:8443...
Starting SSL handshake...
 
No errors, certificate is already trusted
 
Server sent 1 certificate(s):
 
 1 Subject CN=yong mook kim, OU=mkyong, O=mkyong, L=puchong, ST=PJ, C=my
   Issuer  CN=yong mook kim, OU=mkyong, O=mkyong, L=puchong, ST=PJ, C=my
   sha1    32 3e 15 42 96 ba e9 4d 9c 5d e7 5e 6b 0f 30 23 b4 e3 f4 98
   md5     c8 dd a1 af 9f 55 a0 7f 6e 98 10 de 8c 63 1b a5
 
Enter certificate to add to trusted keystore or 'q' to quit: [1]
q
KeyStore not changed
 
C:\>

4.Copy jssecacerts

Copy the generated “jssecacerts” file to your “$JAVA_HOME\jre\lib\security” folder.

5. Done

Run your web service client again, it should be working now.

http://www.mkyong.com/webservices/jax-ws/suncertpathbuilderexception-unable-to-find-valid-certification-path-to-requested-target/

相關推薦

SunCertPathBuilderException: Unable To Find Valid Certification Path To Requested Target

C:\>java InstallCert localhost:8443 Loading KeyStore C:\Program Files\Java\jre6\lib\security\cacerts... Opening connection to localhost:8443... Startin

解決gradle "Error:Cause: unable to find valid certification path to requested target"

這是由於app不信任我們的證書導致https會話失敗。 將jcenter()修改為: jcenter{ url 'http://jcenter.bintray.com' } 1 2 3 參考:http://jimiatwork

Gradle 'project_name' project refresh failed: Unable to find valid certification path to requested

問題所在 今天台風”山竹”來襲,抽空把Mac上面的android studio2.x 升級到最新的Android Studio 3.x,把gradle升級到4.4-all版本,打算重溫一下之前的Android知識慢慢整理成部落格,新建一個簡單的Android專

unable to find valid certification path to requested target

也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!                機器上有好幾套JRE 都新增進去了還是不行,無奈之下使用keytool -import -keystore %JAVA_HOME%/jre/lib/securi

java 訪問 https,unable to find valid certification path to requested target

package com.zt.nyfac; import com.google.gson.Gson; import com.zt.JDBC; import com.zt.prices.Collection; import org.apache.log4j.Logger;

CLIENT_0004:Unable to find valid Kerberos ticket cache (kinit)

con failed .get pen find fin .com bre thread 背景 今天在使用JavaAPI來連接sqoop1.99.7的時候,遇到了個錯誤。 錯誤信息如下: 0 [main] WARN org.apache.hadoop.util.

Android CTS測試中./cts-tradefed出現Unable to find aapt in path 解決方案

cts測試,本來測試得好好的,關閉終端後重新開啟,再次開啟,執行./cts-tradefed命令出錯,顯示Unable to find aapt in path  解決方案: 1.安裝aapt 輸入sudo apt-get install aapt 安裝成功後重新輸入

MYSQL安裝報錯 -- 出現Failed to find valid data directory.

執行環境:windows10 資料庫版本:mysql.8.0.12 安裝方式:rpm包直接安裝 問題描述: mysql初始化的時候找不到對應的資料庫儲存目錄 報錯程式碼: 2018-10-13T03:29:24.179826Z 0 [System] [MY-01

Mysql免安裝配置方法 Failed to find valid data directory.&& NET HELPMSG 3534問題解決

1.首先配置文件,配置環境變數 [mysql]   # 設定mysql客戶端預設字符集   default-character-set=UTF8MB4   [mysqld]   #設定3306埠   port = 3306   # 設定m

xcrun: error: unable to find utility "PackageApplication", not a developer tool or in PATH

view chmod baidu aid log nts pac mod ica Xcode升級到8.3後 用命令進行打包 提示下面這個錯誤 xcrun: error: unable to find utility "PackageApplication", not a

Unable to find remote helper for 'https'

情況 hub 沒有 目前 root one height copyto spa 出現這個報錯,說明git目前的狀態是正常的,要麽沒裝好,要麽自己解決壓縮安裝導致沒有權限 第三次情況是,使用yum install git 重新安裝後,仍然報錯,是因為環境變量中GIT_HOM

【Python】selenium調用IE11瀏覽器,報錯“找不到元素”NoSuchWindowException: Message:Unable to find element on closed window

conn ont csdn creates logs 註冊 target get 意思 當編寫自動化腳本,定位瀏覽器元素時,報如下錯誤: 代碼: >>> # coding=utf-8 >>> from selenium import w

Git出現fatal: Unable to find remote helper for 'https'

tools yourself title https self doc ref pri 安裝 使用Git遠程獲取代碼 [plain] view plain copy print? git clone https://github.com/twlkyao/f

git更新失敗Probably the path to Git executable is not valid

alt size 路徑 cut val img 修改路徑 目錄 http git更新代碼失敗 檢查setting配置,發現路徑配置錯誤 找對git的安裝目錄,修改路徑後保存即可 git更新失敗Probably the path to Git executable

Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.5.6.RELEASE:repackage failed: Unable to find main class

spl final package exce main project clas ini exit 異常 [INFO] --- spring-boot-maven-plugin:1.5.6.RELEASE:repackage (default) @ spring-boot

pod lib lint 報錯 Unable to find a specification for `AMap2DMap` depended upon by `DingtalkPod

logs ios ring ida lean tps erro git err 執行 pod驗證 報錯如下 ? DingtalkPod git:(2.0.0) ? pod lib lint --sources=‘https://github.com/AloneMonkey

錯誤 Unable to find vcvarsall.bat 的終極無敵最完美的解決辦法

.bat vc++ 計算 解釋 計算器 bat window win7 mnt Windows 上通過 pip 安裝 python 包,經常會出現這種錯誤。 如:pip install pyodbc。 這種錯誤的簡單明了解釋就是:python 編譯器找不到計算機上面的

VMware安裝VMware tool是 遇到The path "" is not a valid path to the 3.10.0-693.el7.x86_64 kernel headers.

版本 ron not kernel nbsp valid header function install The path "" is not a valid path to the 3.10.0-693.el7.x86_64 kernel headers.問題是找不到內核

windows編譯python擴展Unable to find vcvarsall

python在windows平臺上安裝比如twisted,gevent時會報出該錯誤,在網上找了一些解決辦法大多都是說將編譯器修改為mingw32,而我覺得此辦法稍顯麻煩,剛好電腦上安裝有VisualStudio,找了一圈發現只需設置環境變量即可,此法正合我意。 操作步驟如下: 打開Visual Studi

file_get_contents()獲取https出現這個錯誤Unable to find the wrapper “https” – did

AC ans html 解決 itl follow htm erer -c file_get_contents()獲取https出現這個錯誤Unable to find the wrapper “https” – did 解決辦法一,如果你是用的服務器,可以參考這個辦法