如何解释java ssl调试输出

时间:2018-01-11 09:50:04

标签: java ssl

Hello我的https请求返回此异常javax.net.ssl.SSLPeerUnverifiedException:peer not authenticated

这是我的调试输出

Allow unsafe renegotiation: false
Allow legacy hello messages: true
Is initial handshake: true
Is secure renegotiation: false
%% No cached client session
*** ClientHello, TLSv1
RandomCookie:  GMT: 1515663662 bytes = { 160, 16, 29, 166, 43, 3, 9, 234, 105, 145, 41, 140, 254, 201, 135, 187, 135, 225, 4, 5, 118, 153, 239, 207, 64, 149, 190, 195 }
Session ID:  {}
Cipher Suites: [TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, TLS_ECDHE_RSA_WITH_RC4_128_SHA, SSL_RSA_WITH_RC4_128_SHA, TLS_ECDH_ECDSA_WITH_RC4_128_SHA, TLS_ECDH_RSA_WITH_RC4_128_SHA, SSL_RSA_WITH_RC4_128_MD5, TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
Compression Methods:  { 0 }
Extension elliptic_curves, curve names: {secp256r1, sect163k1, sect163r2, secp192r1, secp224r1, sect233k1, sect233r1, sect283k1, sect283r1, secp384r1, sect409k1, sect409r1, secp521r1, sect571k1, sect571r1, secp160k1, secp160r1, secp160r2, sect163r1, secp192k1, sect193r1, sect193r2, secp224k1, sect239k1, secp256k1}
Extension ec_point_formats, formats: [uncompressed]
***
myExecutor-1, WRITE: TLSv1 Handshake, length = 163


myExecutor-1, handling exception: java.net.SocketException: Connection reset
myExecutor-1, SEND TLSv1 ALERT:  fatal, description = unexpected_message
myExecutor-1, WRITE: TLSv1 Alert, length = 2
myExecutor-1, Exception sending alert: java.net.SocketException: Broken pipe
myExecutor-1, called closeSocket()
myExecutor-1, IOException in getSession():  java.net.SocketException: Connection reset
myExecutor-1, called close()
myExecutor-1, called closeInternal(true)
myExecutor-1, called close()
myExecutor-1, called closeInternal(true)
javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
    at sun.security.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:421)
    at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:128)
    at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:390)
    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:148)
    at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:149)
    at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:121)
    at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:561)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:415)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:732)

我还安装了Java Cryptography Extension而不能正常工作

1 个答案:

答案 0 :(得分:1)

如何解读:

  

是初始握手:是 - >它是第一次接触,如果它可疑的话,向用户显示警告的最佳位置

     

没有缓存的客户端会话 - >我们没有会议

     

%%没有缓存的客户端会话 - >套接字是打开的

     

WRITE:TLSv1 Handshake,length = 163 - >握手正在发送

     

myExecutor-1,处理异常:java.net.SocketException:连接重置 - >套接字已关闭

     

处理异常:java.net.SocketException:连接重置 - >启动客户端的异常处理。客户端我的意思是浏览器,而不是服务器。 Putty不是SSHD。

     

myExecutor-1,SEND TLSv1 ALERT:fatal,description = unexpected_message 套接字已关闭,但异常处理不知道套接字已关闭,尝试向服务器发送警报是套接字关闭后无望。是的,在关闭套接字的情况下,客户端不应该尝试向服务器发送警报,这可能是一个错误但没有影响。

     

myExecutor-1,WRITE:TLSv1警报,长度= 2 现在他尝试将警报发送给发件人,但此必须产生以下异常,因为套接字已关闭。

     

javax.net.ssl.SSLPeerUnverifiedException:peer not authenticated >我们走了

不幸的是,服务器没有提供他退出连接的原因。可以有多种选择:

  1. 连接服务器的电缆已用刀切断。
  2. 软件服务器死了。
  3. 硬件服务器死了。
  4. 服务器不使用TLS协议,而是使用不兼容的其他协议。