使用apache客户端和rest模板发送Https连接问题

时间:2018-05-17 06:15:48

标签: java rest

我尝试了stackoverflow中提到的所有解决方案,但似乎没有任何效果。 我需要一些精确的解决方案来解决这个问 不要标记已经回答或重复,因为我已经厌倦了google和stackoverflow中提到的所有解决方案

2018-05-17 11:42:10,981 main DEBUG LoggerContext[name=15d56d5, org.apache.logging.log4j.core.LoggerContext@110e3b5] started OK.
trustStore is: C:\Prasad\Softwares\jdk1.7.0_79\jre\lib\security\cacerts
trustStore type is : jks
trustStore provider is : 
init truststore
SunX509: skip default keystore: java.security.KeyStoreException: jks not found
trigger seeding of SecureRandom
done seeding SecureRandom
keyStore is : 
keyStore type is : jks
keyStore provider is : 
init keystore

main, WRITE: TLSv1 Handshake, length = 107
main, received EOFException: error
main, handling exception: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
main, SEND TLSv1 ALERT:  fatal, description = handshake_failure
main, WRITE: TLSv1 Alert, length = 2
main, called closeSocket()
Exception in thread "main" org.springframework.web.client.ResourceAccessException: I/O error on GET request for "some url": Remote host closed connection during handshake; nested exception is javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:666)
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:613)
    at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:531)
Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake

1 个答案:

答案 0 :(得分:0)

  • 默认情况下,Java 1.6不支持TLSv2。甲骨文后来发布 支持它,并且不向公众开放。
  • 其中存在相同的问题 2009年发布的Java 1.7。后来oracle发行了对Java 1.7的支持 它对公众开放。
  • Java 1.8默认情况下支持Tslv2。