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
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.
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)
}