java远程计算机终止,java - javax.net.ssl.SSLHandshakeException:远程主机终止了握手 - 堆栈内存溢出...

我已经使用以下命令在Java信任库(cacerts)中安装了证书:

keytool-导入-文件“ C:\\ Users \\ kdursoji \\ Downloads \\ ZscalerRootCertificate-154478.crt” -keystore“ C:\\ Program Files \\ Java \\ jre-9.0.4 \\ lib \\ security \\ cacerts”-别名ZcalerCert

keytool-导入-文件“ C:\\ Users \\ kdursoji \\ Downloads \\ ZscalerRootCertificate-154478.crt” -keystore“ C:\\ Program Files \\ Java \\ jdk-9.0.4 \\ lib \\ security \\ cacerts” -alias ZcalerCert稍后我是尝试点击以下网址

apache http api并得到以下异常:

System property jdk.tls.client.cipherSuites is set to 'null'

System property jdk.tls.server.cipherSuites is set to 'null'

Ignoring disabled cipher suite: SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA

Ignoring disabled cipher suite: SSL_DH_anon_EXPORT_WITH_RC4_40_MD5

Ignoring disabled cipher suite: TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5

Ignoring disabled cipher suite: TLS_ECDHE_ECDSA_WITH_RC4_128_SHA

Ignoring disabled cipher suite: SSL_DH_anon_WITH_RC4_128_MD5

Ignoring disabled cipher suite: SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA

Ignoring disabled cipher suite: TLS_ECDH_anon_WITH_RC4_128_SHA

Ignoring disabled cipher suite: TLS_KRB5_EXPORT_WITH_RC4_40_SHA

Ignoring disabled cipher suite: SSL_RSA_EXPORT_WITH_DES40_CBC_SHA

Ignoring disabled cipher suite: TLS_KRB5_WITH_RC4_128_SHA

Ignoring disabled cipher suite: SSL_RSA_EXPORT_WITH_RC4_40_MD5

Ignoring disabled cipher suite: TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA

Ignoring disabled cipher suite: TLS_KRB5_EXPORT_WITH_RC4_40_MD5

Ignoring disabled cipher suite: TLS_ECDH_ECDSA_WITH_RC4_128_SHA

Ignoring disabled cipher suite: TLS_KRB5_WITH_RC4_128_MD5

Ignoring disabled cipher suite: SSL_RSA_WITH_RC4_128_SHA

Ignoring disabled cipher suite: TLS_ECDH_RSA_WITH_RC4_128_SHA

Ignoring disabled cipher suite: SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA

Ignoring disabled cipher suite: TLS_ECDHE_RSA_WITH_RC4_128_SHA

Ignoring disabled cipher suite: SSL_RSA_WITH_RC4_128_MD5

Inaccessible trust store: C:\Program Files\Java\jre-9.0.4\lib\security\jssecacerts

trustStore is: C:\Program Files\Java\jre-9.0.4\lib\security\cacerts

trustStore type is: pkcs12

trustStore provider is:

the last modified time is: Thu Aug 01 21:03:36 IST 2019

Reload the trust store

Reload trust certs

Reloaded 105 trust certs

adding as trusted cert:

Subject: CN=Equifax Secure Global eBusiness CA-1, O=Equifax Secure Inc., C=US

Issuer: CN=Equifax Secure Global eBusiness CA-1, O=Equifax Secure Inc., C=US

Algorithm: RSA; Serial number: 0xc3517

Valid from Mon Jun 21 09:30:00 IST 1999 until Mon Jun 22 09:30:00 IST 2020

adding as trusted cert:

Subject: CN=Entrust Root Certification Authority - EC1, OU="(c) 2012 Entrust, Inc. - for authorized use only", OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US

Issuer: CN=Entrust Root Certification Authority - EC1, OU="(c) 2012 Entrust, Inc. - for authorized use only", OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US

Algorithm: EC; Serial number: 0xa68b79290000000050d091f9

Valid from Tue Dec 18 20:55:36 IST 2012 until Fri Dec 18 21:25:36 IST 2037

adding as trusted cert:

Subject: CN=SecureTrust CA, O=SecureTrust Corporation, C=US

Issuer: CN=SecureTrust CA, O=SecureTrust Corporation, C=US

Algorithm: RSA; Serial number: 0xcf08e5c0816a5ad427ff0eb271859d0

Valid from Wed Nov 08 01:01:18 IST 2006 until Tue Jan 01 01:10:55 IST 2030

adding as trusted cert:

Subject: OU=Security Communication RootCA1, O=SECOM Trust.net, C=JP

Issuer: OU=Security Communication RootCA1, O=SECOM Trust.net, C=JP

Algorithm: RSA; Serial number: 0x0

Valid from Tue Sep 30 09:50:49 IST 2003 until Sat Sep 30 09:50:49 IST 2023

adding as trusted cert:

Subject: CN=DigiCert Global Root CA, OU=www.digicert.com, O=DigiCert Inc, C=US

Issuer: CN=DigiCert Global Root CA, OU=www.digicert.com, O=DigiCert Inc, C=US

Algorithm: RSA; Serial number: 0x83be056904246b1a1756ac95991c74a

Valid from Fri Nov 1

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
引用:HTTP Status 500 - javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find ... 引用:Java Spring应用发送数据报如下问题。 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 原因分析: 引用:用httpclient访问https资源时,会出现异常,与环境也有关系,有些机器请求正常。 解决方案: 在HTTPS通信中,当Java程序尝试与服务端建立安全连接时,会进行SSL握手过程。如果在握手过程中出现异常javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException,可能是由于证书验证失败导致的。这种异常通常有两种原因:一是服务端证书不被信任,二是客户端无法找到合适的证书链。 解决这个问题的方法有以下几种: 1. 信任自签名证书:可以通过自定义TrustManager来信任自签名的证书。但这种方法存在安全风险,因为所有的自签名证书都会被信任。 2. 导入服务端证书:可以将服务端的证书导入到Java的信任证书库中,以确保它被信任。可以使用keytool工具将证书导入到Java信任库中。 3. 禁用证书验证:在开发环境中,可以禁用证书验证来避免这个问题。但在生产环境中不建议这样做,因为会降低通信的安全性。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值