sun.security.validator.ValidatorException: No trusted certificate found
来源:互联网 发布:江苏开放大学网络教育 编辑:程序博客网 时间:2024/06/16 17:35
剛剛開始做企業網站,修改ssn checknumer,遇到這個錯誤:
faultString: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
按照網上的方法,
%JAVA_HOME%/bin/keytool -import -file service.crt -keystore D:/test/urltest/crt
生成crt后,
在java代碼和被調用的jar代碼中加入
System.setProperty("javax.net.ssl.trustStore","D:/tools/cacerts");
System.setProperty("javax.net.ssl.trustStorePassword","changeit");
但是問題沒有解決,仍然出現錯誤
發現因為是本地目錄,服務器上運行出錯,
修改目錄,
System.setProperty("javax.net.ssl.trustStore","/home/weblogic/bea/user_projects/domains/appsdomain/cer");
運行,不行,還是找不到
本地編譯發現兩個方法的作用一樣:
1,代碼中加入
System.setProperty("javax.net.ssl.trustStore","D:/tools/cacerts");
System.setProperty("javax.Net.ssl.trustStorePassword","changeit");
2、在java的build目錄下
keytool -import -file service.crt -keystore j2sdk1.4.2_05\jre\lib\security\cacerts
代碼中不必添加System.setProperty
服務器上修改cer文件目前還沒有權限,先按照1修改不行
在代碼中加入
+ System.out.println(System.getProperty("user.dir"));
+ System.out.println(System.getProperty("java.home"));
+ System.out.println(System.getProperty("java.library.path"));
打印出來的結果如下:
/home/weblogic/bea/user_projects/domains/appsdomain
/home/weblogic/bea/jdk142_11/jre
/home/weblogic/bea/jdk142_11/jre/lib/i386/client:/home/weblogic/bea/jdk142_11/jre/lib/i386:/home/weblogic/bea/jdk142_11/jre/../lib/i386:/home/weblogic/bea/weblogic81/server/lib/linux/i686:/home/weblogic/bea/weblogic81/server/lib/linux/i686/oci920_8
但是字節設置目錄home/weblogic/bea/user_projects/domains/appsdomain/cer為什麼失敗還是不清楚,
用keytool -imaport -file *.cer -keystore cacerts 然後替換掉->>>home/weblogic/bea/jdk142_11/jre/lib/security/cacerts
再次運行,這次終於OK
- sun.security.validator.ValidatorException: No trusted certificate found
- sun.security.validator.ValidatorException: No trusted certificate found
- sun.security.validator.ValidatorException
- No trusted certificate found解决方案
- sun.security.validator.ValidatorException: PKIX path building failed:
- 报错javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException
- sun.security.validator.ValidatorException: PKIX path building failed:
- 关于 No trusted certificate found 异常
- sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath
- Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provid
- Websphere 6.1 java ssl handshake exception No trusted certificate found
- javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building f
- Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path
- javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException: PKIX path building失败
- javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building f
- javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building
- 解决 javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path buildin
- 爬数据出现错误javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException
- jq操作div 移除第二个div
- logback异步输出日志的配置方法和源码分析
- android studio adb遇到的问题
- java http工具类
- 17、oracle:max,in,or,trunc,sql变量的使用以及分号
- sun.security.validator.ValidatorException: No trusted certificate found
- 使用Python计算逆波兰表达式
- UVA
- 解决错误503:com.sun.mail.smtp.SMTPAddressFailedException: 503 the server need auth(15D98013BE0)
- 并发:死锁和饥饿
- SVN迁移重启后无法访问客户端
- 浅谈大数据行业应用
- UIScrollView添加AutoLayout约束的坑
- java 剑指offor 第四题:输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树。假设输入的前序遍历和中序遍历的结果中都不含重复的数字。例如输入前序遍历序列{1,2,4,7,3,5,6,8}