Java JDK 1.6 SSLHandshakeException

时间:2019-05-16 15:31:58

标签: java sslhandshakeexception

我正在尝试从使用JDK 1.6的Jboss 5连接到服务URL。

我正在获取SSLHandshakeException。

URL的连接已使用协议TLS1.2,密码TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384和256位密钥进行了加密。

我已启用TLSv1.2,更新了JCE6,但仍然面临异常。

在日志中,我看到“安全重新协商:错误”。

因此,在代码中,我使用了:

System.setProperty("https.protocols", "TLSv1.1,TLSv1.2");
System.setProperty( "sun.security.ssl.allowUnsafeRenegotiation", "true");

但是它仍然无法解决问题。 如何解决呢?这是由于密码不兼容吗? 请在下面的SSL调试日志中找到:

10:01:06,305 INFO  [STDOUT] Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
10:01:06,309 INFO  [STDOUT] Ignoring unavailable cipher suite: TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
10:01:06,311 INFO  [STDOUT] Ignoring unavailable cipher suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
10:01:06,311 INFO  [STDOUT] Ignoring unavailable cipher suite: TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
10:01:06,312 INFO  [STDOUT] Ignoring unavailable cipher suite: TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
10:01:06,312 INFO  [STDOUT] Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
10:01:06,313 INFO  [STDOUT] Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
10:01:06,314 INFO  [STDOUT] Ignoring unavailable cipher suite: TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
10:01:06,314 INFO  [STDOUT] Ignoring unavailable cipher suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
10:01:06,315 INFO  [STDOUT] Ignoring unavailable cipher suite: TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
10:01:06,315 INFO  [STDOUT] Ignoring unavailable cipher suite: TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
10:01:06,316 INFO  [STDOUT] Ignoring unavailable cipher suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
10:01:06,317 INFO  [STDOUT] Ignoring unavailable cipher suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
10:01:06,318 INFO  [STDOUT] Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
10:01:06,318 INFO  [STDOUT] Ignoring unavailable cipher suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
10:01:06,319 INFO  [STDOUT] Ignoring unavailable cipher suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
10:01:06,320 INFO  [STDOUT] Ignoring unavailable cipher suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
10:01:06,321 INFO  [STDOUT] Ignoring unavailable cipher suite: TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
10:01:06,322 INFO  [STDOUT] Ignoring unavailable cipher suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
10:01:06,323 INFO  [STDOUT] Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
10:01:06,376 INFO  [STDOUT] Allow unsafe renegotiation: false
Allow legacy hello messages: true
Is initial handshake: true
Is secure renegotiation: false
10:01:06,456 INFO  [STDOUT] Ignoring unsupported cipher suite: TLS_RSA_WITH_AES_256_CBC_SHA256 for TLSv1
10:01:06,457 INFO  [STDOUT] Ignoring unsupported cipher suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 for TLSv1
10:01:06,458 INFO  [STDOUT] Ignoring unsupported cipher suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 for TLSv1
10:01:06,460 INFO  [STDOUT] Ignoring unsupported cipher suite: TLS_RSA_WITH_AES_256_CBC_SHA256 for TLSv1.1
10:01:06,460 INFO  [STDOUT] Ignoring unsupported cipher suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 for TLSv1.1
10:01:06,461 INFO  [STDOUT] Ignoring unsupported cipher suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 for TLSv1.1
10:01:06,474 INFO  [STDOUT] %% No cached client session
10:01:06,485 INFO  [STDOUT] *** ClientHello, TLSv1.2
10:01:06,487 INFO  [STDOUT] RandomCookie:  
10:01:06,488 INFO  [STDOUT] GMT: 1541241650 
10:01:06,488 INFO  [STDOUT] bytes = { 
10:01:06,489 INFO  [STDOUT] 137
10:01:06,490 INFO  [STDOUT] , 
10:01:06,490 INFO  [STDOUT] 180
10:01:06,491 INFO  [STDOUT] , 
10:01:06,491 INFO  [STDOUT] 224
10:01:06,492 INFO  [STDOUT] , 
10:01:06,493 INFO  [STDOUT] 206
10:01:06,493 INFO  [STDOUT] , 
10:01:06,494 INFO  [STDOUT] 230
10:01:06,494 INFO  [STDOUT] , 
10:01:06,495 INFO  [STDOUT] 103
10:01:06,496 INFO  [STDOUT] , 
10:01:06,496 INFO  [STDOUT] 235
10:01:06,497 INFO  [STDOUT] , 
10:01:06,498 INFO  [STDOUT] 66
10:01:06,498 INFO  [STDOUT] , 
10:01:06,499 INFO  [STDOUT] 161
10:01:06,500 INFO  [STDOUT] , 
10:01:06,500 INFO  [STDOUT] 8
10:01:06,500 INFO  [STDOUT] , 
10:01:06,501 INFO  [STDOUT] 192
10:01:06,501 INFO  [STDOUT] , 
10:01:06,501 INFO  [STDOUT] 146
10:01:06,501 INFO  [STDOUT] , 
10:01:06,501 INFO  [STDOUT] 181
10:01:06,501 INFO  [STDOUT] , 
10:01:06,501 INFO  [STDOUT] 6
10:01:06,501 INFO  [STDOUT] , 
10:01:06,501 INFO  [STDOUT] 196
10:01:06,501 INFO  [STDOUT] , 
10:01:06,501 INFO  [STDOUT] 55
10:01:06,501 INFO  [STDOUT] , 
10:01:06,502 INFO  [STDOUT] 29
10:01:06,502 INFO  [STDOUT] , 
10:01:06,502 INFO  [STDOUT] 33
10:01:06,502 INFO  [STDOUT] , 
10:01:06,502 INFO  [STDOUT] 13
10:01:06,502 INFO  [STDOUT] , 
10:01:06,502 INFO  [STDOUT] 217
10:01:06,502 INFO  [STDOUT] , 
10:01:06,502 INFO  [STDOUT] 68
10:01:06,502 INFO  [STDOUT] , 
10:01:06,502 INFO  [STDOUT] 204
10:01:06,502 INFO  [STDOUT] , 
10:01:06,502 INFO  [STDOUT] 98
10:01:06,502 INFO  [STDOUT] , 
10:01:06,502 INFO  [STDOUT] 227
10:01:06,503 INFO  [STDOUT] , 
10:01:06,503 INFO  [STDOUT] 70
10:01:06,503 INFO  [STDOUT] , 
10:01:06,503 INFO  [STDOUT] 141
10:01:06,503 INFO  [STDOUT] , 
10:01:06,503 INFO  [STDOUT] 54
10:01:06,503 INFO  [STDOUT] , 
10:01:06,503 INFO  [STDOUT] 191
10:01:06,503 INFO  [STDOUT]  }
10:01:06,503 INFO  [STDOUT] Session ID:  
10:01:06,504 INFO  [STDOUT] {}
10:01:06,504 INFO  [STDOUT] Cipher Suites: [TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
10:01:06,504 INFO  [STDOUT] Compression Methods:  { 
10:01:06,504 INFO  [STDOUT] 0
10:01:06,504 INFO  [STDOUT]  }
10:01:06,505 INFO  [STDOUT] Extension signature_algorithms, signature_algorithms: SHA512withECDSA, SHA512withRSA, SHA384withECDSA, SHA384withRSA, SHA256withECDSA, SHA256withRSA, SHA1withECDSA, SHA1withRSA, SHA1withDSA
10:01:06,505 INFO  [STDOUT] ***
10:01:06,506 INFO  [STDOUT] http-0.0.0.0-8080-1:ipaddr=192.168.91.1;path=/dyn/admin/nucleus/atg/integrations/order/service/OMSOAuthTokenService/;sessionid=E75C74FB1798F05F43CE837C95D40A02, WRITE: TLSv1.2 Handshake, length = 101
10:01:06,520 INFO  [STDOUT] http-0.0.0.0-8080-1:ipaddr=192.168.91.1;path=/dyn/admin/nucleus/atg/integrations/order/service/OMSOAuthTokenService/;sessionid=E75C74FB1798F05F43CE837C95D40A02, READ: TLSv1.2 Alert, length = 2
10:01:06,520 INFO  [STDOUT] http-0.0.0.0-8080-1:ipaddr=192.168.91.1;path=/dyn/admin/nucleus/atg/integrations/order/service/OMSOAuthTokenService/;sessionid=E75C74FB1798F05F43CE837C95D40A02
10:01:06,520 INFO  [STDOUT] , RECV TLSv1.2 ALERT:  
10:01:06,520 INFO  [STDOUT] fatal, 
10:01:06,522 INFO  [STDOUT] handshake_failure
10:01:06,522 INFO  [STDOUT] http-0.0.0.0-8080-1:ipaddr=192.168.91.1;path=/dyn/admin/nucleus/atg/integrations/order/service/OMSOAuthTokenService/;sessionid=E75C74FB1798F05F43CE837C95D40A02, called closeSocket()
10:01:06,523 INFO  [STDOUT] http-0.0.0.0-8080-1:ipaddr=192.168.91.1;path=/dyn/admin/nucleus/atg/integrations/order/service/OMSOAuthTokenService/;sessionid=E75C74FB1798F05F43CE837C95D40A02, handling exception: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
10:01:06,523 INFO  [STDOUT] http-0.0.0.0-8080-1:ipaddr=192.168.91.1;path=/dyn/admin/nucleus/atg/integrations/order/service/OMSOAuthTokenService/;sessionid=E75C74FB1798F05F43CE837C95D40A02, called close()
10:01:06,524 INFO  [STDOUT] http-0.0.0.0-8080-1:ipaddr=192.168.91.1;path=/dyn/admin/nucleus/atg/integrations/order/service/OMSOAuthTokenService/;sessionid=E75C74FB1798F05F43CE837C95D40A02, called closeInternal(true)
10:01:06,524 INFO  [STDOUT] http-0.0.0.0-8080-1:ipaddr=192.168.91.1;path=/dyn/admin/nucleus/atg/integrations/order/service/OMSOAuthTokenService/;sessionid=E75C74FB1798F05F43CE837C95D40A02, called close()
10:01:06,524 INFO  [STDOUT] http-0.0.0.0-8080-1:ipaddr=192.168.91.1;path=/dyn/admin/nucleus/atg/integrations/order/service/OMSOAuthTokenService/;sessionid=E75C74FB1798F05F43CE837C95D40A02, called closeInternal(true)
10:01:06,524 INFO  [STDOUT] http-0.0.0.0-8080-1:ipaddr=192.168.91.1;path=/dyn/admin/nucleus/atg/integrations/order/service/OMSOAuthTokenService/;sessionid=E75C74FB1798F05F43CE837C95D40A02, called close()
10:01:06,524 INFO  [STDOUT] http-0.0.0.0-8080-1:ipaddr=192.168.91.1;path=/dyn/admin/nucleus/atg/integrations/order/service/OMSOAuthTokenService/;sessionid=E75C74FB1798F05F43CE837C95D40A02, called closeInternal(true)
10:01:06,526 ERROR [STDERR] javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
10:01:06,529 ERROR [STDERR]     at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:172)
10:01:06,529 ERROR [STDERR]     at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:134)
10:01:06,529 ERROR [STDERR]     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1970)
10:01:06,529 ERROR [STDERR]     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1077)
10:01:06,529 ERROR [STDERR]     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1323)
10:01:06,529 ERROR [STDERR]     at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:700)
10:01:06,530 ERROR [STDERR]     at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:98)
10:01:06,530 ERROR [STDERR]     at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
10:01:06,530 ERROR [STDERR]     at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
10:01:06,530 ERROR [STDERR]     at org.apache.commons.httpclient.methods.StringRequestEntity.writeRequest(StringRequestEntity.java:146)
10:01:06,530 ERROR [STDERR]     at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:499)
10:01:06,530 ERROR [STDERR]     at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2114)
10:01:06,530 ERROR [STDERR]     at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)
10:01:06,530 ERROR [STDERR]     at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
10:01:06,530 ERROR [STDERR]     at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
10:01:06,530 ERROR [STDERR]     at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
10:01:06,530 ERROR [STDERR]     at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
10:01:06,531 ERROR [STDERR]     at com.bn.service.OMSOAuthTokenService.generateAccessToken(OMSOAuthTokenService.java:75)
10:01:06,531 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
10:01:06,531 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
10:01:06,531 ERROR [STDERR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
10:01:06,531 ERROR [STDERR]     at java.lang.reflect.Method.invoke(Method.java:597)
10:01:06,531 ERROR [STDERR]     at atg.nucleus.ServiceAdminServlet.printMethodInvocation(ServiceAdminServlet.java:1473)
10:01:06,531 ERROR [STDERR]     at atg.nucleus.ServiceAdminServlet.service(ServiceAdminServlet.java:251)
10:01:06,531 ERROR [STDERR]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
10:01:06,531 ERROR [STDERR]     at atg.nucleus.Nucleus.service(Nucleus.java:2992)
10:01:06,531 ERROR [STDERR]     at atg.nucleus.Nucleus.service(Nucleus.java:2892)
10:01:06,531 ERROR [STDERR]     at atg.servlet.pipeline.DispatcherPipelineServletImpl.service(DispatcherPipelineServletImpl.java:253)
10:01:06,531 ERROR [STDERR]     at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:157)
10:01:06,531 ERROR [STDERR]     at atg.servlet.pipeline.ServletPathPipelineServlet.service(ServletPathPipelineServlet.java:208)
10:01:06,531 ERROR [STDERR]     at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:157)
10:01:06,531 ERROR [STDERR]     at atg.security.ExpiredPasswordAdminServlet.service(ExpiredPasswordAdminServlet.java:312)
10:01:06,532 ERROR [STDERR]     at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:157)
10:01:06,532 ERROR [STDERR]     at atg.servlet.pipeline.BasicAuthenticationPipelineServlet.service(BasicAuthenticationPipelineServlet.java:555)
10:01:06,532 ERROR [STDERR]     at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:157)
10:01:06,532 ERROR [STDERR]     at atg.servlet.pipeline.DynamoPipelineServlet.service(DynamoPipelineServlet.java:491)
10:01:06,532 ERROR [STDERR]     at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:157)
10:01:06,532 ERROR [STDERR]     at atg.dtm.TransactionPipelineServlet.service(TransactionPipelineServlet.java:249)
10:01:06,532 ERROR [STDERR]     at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:157)
10:01:06,532 ERROR [STDERR]     at atg.servlet.pipeline.SecurityServlet.service(SecurityServlet.java:196)
10:01:06,532 ERROR [STDERR]     at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:157)
10:01:06,532 ERROR [STDERR]     at atg.servlet.pipeline.HeadPipelineServlet.passRequest(HeadPipelineServlet.java:1251)
10:01:06,532 ERROR [STDERR]     at atg.servlet.pipeline.HeadPipelineServlet.service(HeadPipelineServlet.java:929)
10:01:06,532 ERROR [STDERR]     at atg.servlet.pipeline.PipelineableServletImpl.service(PipelineableServletImpl.java:272)
10:01:06,532 ERROR [STDERR]     at atg.nucleus.servlet.NucleusProxyServlet.service(NucleusProxyServlet.java:237)
10:01:06,532 ERROR [STDERR]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
10:01:06,532 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
10:01:06,532 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
10:01:06,533 ERROR [STDERR]     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
10:01:06,533 ERROR [STDERR]     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
10:01:06,533 ERROR [STDERR]     at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)
10:01:06,533 ERROR [STDERR]     at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)
10:01:06,533 ERROR [STDERR]     at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
10:01:06,533 ERROR [STDERR]     at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
10:01:06,533 ERROR [STDERR]     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
10:01:06,533 ERROR [STDERR]     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
10:01:06,533 ERROR [STDERR]     at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
10:01:06,533 ERROR [STDERR]     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
10:01:06,533 ERROR [STDERR]     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
10:01:06,533 ERROR [STDERR]     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
10:01:06,533 ERROR [STDERR]     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
10:01:06,533 ERROR [STDERR]     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)
10:01:06,534 ERROR [STDERR]     at java.lang.Thread.run(Thread.java:682)
10:06:40,500 INFO  [STDOUT] Finalizer, called close()
10:06:40,506 INFO  [STDOUT] Finalizer, called closeInternal(true)

0 个答案:

没有答案