How to fix 'SSLHandshakeException: Received fatal alert: decode_error'?

后端 未结 2 1165
礼貌的吻别
礼貌的吻别 2021-01-21 19:15

We have a java application that reads our customers public calendars - for example from google (https://calendar.google.com/calendar/ical/...) or icloud (webcal://p58-caldav.icl

相关标签:
2条回答
  • 2021-01-21 19:46

    I experienced this same exact issue yesterday with a Java application that tried to connect to https://apple.com:443. I found that a different JDK on a different (Docker) OS fixed the issue. In my specific case, OpenJDK on Alpine didn't work but other Dockerized OpenJDKs (like adoptopenjdk/openjdk11) worked fine.

    0 讨论(0)
  • 2021-01-21 19:46

    I faced Received fatal alert: decode_error while connecting with apple cloud urls. I was able to fix it by explicitly setting the protocol as TLS 1.2.

    For eg: in kotlin update your spring RestTemplate as below ,

    fun restTemplateWithTLS12(): RestTemplate { val requestFactory = HttpComponentsClientHttpRequestFactory() val sslContext = SSLContexts.custom().setProtocol("TLSv1.2").build() val clientBuilder = HttpClients.custom().setSSLSocketFactory(SSLConnectionSocketFactory(sslContext)) requestFactory.httpClient = clientBuilder.build() return RestTemplate(requestFactory) }

    0 讨论(0)
提交回复
热议问题