question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

Hi !

I got an SSLProtocolException when I try to access https://www.allianz.fr or https://www.fluo.com/ through browsermob-proxy.

javax.net.ssl.SSLProtocolException: handshake alert:  unrecognized_name
    at sun.security.ssl.ClientHandshaker.handshakeAlert(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.recvAlert(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:275)
    at net.lightbody.bmp.proxy.http.TrustingSSLSocketFactory.createLayeredSocket(TrustingSSLSocketFactory.java:77)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:254)
    at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:123)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:318)
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:219)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:86)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at net.lightbody.bmp.proxy.http.BrowserMobHttpClient.execute(BrowserMobHttpClient.java:824)
    at net.lightbody.bmp.proxy.http.BrowserMobHttpClient.execute(BrowserMobHttpClient.java:625)
    at net.lightbody.bmp.proxy.http.BrowserMobHttpRequest.execute(BrowserMobHttpRequest.java:148)
    at net.lightbody.bmp.proxy.BrowserMobProxyHandler.proxyPlainTextRequest(BrowserMobProxyHandler.java:265)
    at net.lightbody.bmp.proxy.selenium.SeleniumProxyHandler.handle(SeleniumProxyHandler.java:185)
    at net.lightbody.bmp.proxy.jetty.http.HttpContext.handle(HttpContext.java:1509)
    at net.lightbody.bmp.proxy.jetty.http.HttpContext.handle(HttpContext.java:1461)
    at net.lightbody.bmp.proxy.jetty.http.HttpServer.service(HttpServer.java:892)
    at net.lightbody.bmp.proxy.jetty.http.HttpConnection.service(HttpConnection.java:815)
    at net.lightbody.bmp.proxy.jetty.http.HttpConnection.handleNext(HttpConnection.java:981)
    at net.lightbody.bmp.proxy.jetty.http.HttpConnection.handle(HttpConnection.java:832)
    at net.lightbody.bmp.proxy.jetty.http.SocketListener.handleConnection(SocketListener.java:245)
    at net.lightbody.bmp.proxy.jetty.util.ThreadedServer.handle(ThreadedServer.java:357)
    at net.lightbody.bmp.proxy.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:534)

It seems to be due to the Server Name Indication (http://www.ietf.org/rfc/rfc4366.txt : page 8) which is enabled by default in Java 7. http://stackoverflow.com/questions/7615645/ssl-handshake-alert-unrecognized-name-error-since-upgrade-to-java-1-7-0

The simpliest way to resolve the issue would be to add a flag to disabled SNI : java -Djsse.enableSNIExtension=false

But it will disabled the SNI for all the JVM, so it may cause trouble to access other website which required SNI.

A solution to enable SNI and still support misconfigured server is suggest here: http://stackoverflow.com/a/14884941

But I’m not sure it’s the best way to do it. Any opinion ?

Thanks

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jpereira06commented, Aug 18, 2015

http://www.finofilipino.org also fires this error

0reactions
jekhcommented, Apr 23, 2016

This is fixed with the latest release, so I’ll go ahead and close.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SSL handshake alert: unrecognized_name error since ...
When you have received the unrecognized_name warning (fatal in Java), retry opening a SSLSocket , but this time without a host name. This...
Read more >
javax.net.ssl.SSLProtocolException: handshake alert - IBM
How to fix this SSL error javax.net.ssl.SSLProtocolException: handshake alert: unrecognized_name in Websphere Application Server?
Read more >
SSL handshake alert unrecognized name - CloudBees Support
When I try to connect to an SSL server I see this error. javax.net.ssl.SSLProtocolException: handshake alert: unrecognized_name ...
Read more >
ERROR: "javax.net.ssl.SSLProtocolException: handshake alert
This issue occurs if the endpoint server is configured with more than one hostname. Because of this, the Secure agents fail to establish...
Read more >
javax.net.ssl.SSLProtocolException: handshake alert
SSLProtocolException : handshake alert: unrecognized_name at sun.security.ssl.ClientHandshaker.handshakeAlert(ClientHandshaker.java:1441) at ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found