1

spring-boot version: 1.5.21.RELEASE

both the service provider and the service caller are the same spring boot version.

What I want to know is that why it is an SSL error when it is calling a http serivce?

below is part of the stack trace:

Caused by: feign.RetryableException: Unrecognized SSL message, plaintext connection? executing PUT http://serivce-name/service/api
    at feign.FeignException.errorExecuting(FeignException.java:67)
    at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:104)
    at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:76)
    at feign.hystrix.HystrixInvocationHandler$1.run(HystrixInvocationHandler.java:108)
    at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:302)
    at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:298)
    at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:46)
    ... 27 common frames omitted
Caused by: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
    at sun.security.ssl.InputRecord.handleUnknownRecord(InputRecord.java:710)
    at sun.security.ssl.InputRecord.read(InputRecord.java:527)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
    at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1316)
    at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1291)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
    at feign.Client$Default.convertAndSend(Client.java:133)
    at feign.Client$Default.execute(Client.java:73)
Alex
  • 1,737
  • 2
  • 20
  • 35
  • Possible duplicate of [Unrecognized SSL message, plaintext connection? Exception](https://stackoverflow.com/questions/6532273/unrecognized-ssl-message-plaintext-connection-exception) – Spasoje Petronijević Jul 04 '19 at 10:14
  • 1
    I don't think so. According to the message in feign.RetryableException, the feign client is querying an HTTP service, which should not get SSL involved. I think that might be something wrong with the feign client or some configuration. – Alex Jul 04 '19 at 10:23

1 Answers1

0

I had the same issue. I'm using eureka for discovery server and feign client to conect between services. My problem was in then services' eureka configuration.

The source service was configured to use only http protocol:

eureka:
  instance:
    secure-port-enabled: false
    non-secure-port-enabled: true

The target service was configured to use https protocol:

eureka:
  instance:
    secure-port-enabled: true
    non-secure-port-enabled: false

In this configuration, the source server was trying to conect to target server via http protocol, but the target was configured with https.

So, I changed the target configuration like the source and It worked!

Davi Carrano
  • 331
  • 2
  • 4