SSL handshake alert unrecognized name

Article ID:232230748
1 minute readKnowledge base

Issue

When I try to connect to an SSL server I see this error

 javax.net.ssl.SSLProtocolException: handshake alert: unrecognized_name

Resolution

Root cause

The error message is provided by the SNI module (in the JDK >1.7) since the server sends a warning. Browsers are ignoring it, but Java terminates. Oracle means it’s "not a defect": https://bugs.java.com/bugdatabase/view_bug.do?bug_id=7127374

Solution

Since the error message is related to a wrong configuration of virtual hosts on the server side, the solution is to review your current virtual hosts' configuration of the server that is reached by the Jenkins instance.

Workaround

With JDK >1.7 we usually recommended to add -Djsse.enableSNIExtension=false to Jenkins options. However, since some connections like the update center connections, need the enableSNIExtension enabled, we don’t recommend this option anymore.