webmetrics / browsermob-proxy

NOTICE: this project has been forked and is being maintained at https://github.com/lightbody/browsermob-proxy
https://github.com/lightbody/browsermob-proxy
Apache License 2.0
234 stars 773 forks source link

Unable to fetch SSL resources with upstream proxy. #79

Closed nirvdrum closed 11 years ago

nirvdrum commented 11 years ago

BrowserMob Proxy is unable to fetch SSL resources when talking to an upstream proxy. The error message is:

"javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated"

nirvdrum commented 11 years ago

So, as it turns out the issue was an Apache server that didn't set ServerAlias and messed up its SSL config. Java 7 has SNI enabled, so the SSL issue manifested as an SSLPeerUnverifiedException. My fix can't work around the SNI problem, but it does make things get further along until you'll eventually hit a "javax.net.ssl.SSLProtocolException: handshake alert: unrecognized_name". That error is easily found in Google to be related to SNI.

For those stumbling upon this issue, SNI can be disabled with: -Djsse.enableSNIExtension=false as a JVM arg.