webmetrics/browsermob-proxy — Issue #24: java.net.UnknownHostException when ProxyServer has upstream proxy
Author: JuanCerezuela
Created: 2011-12-12 16:38:27+00:00
State: open

WHEN ProxyServer is configured to use an upstream HTTP and SSL proxy:
final ProxyServer proxyServer = new ProxyServer(browserMobProxyPort);
Map options = new HashMap();
options.put("httpProxy", upstreamProxyHost + ":" + upstreamProxyPort);
proxyServer.start();
proxyServer.setOptions(options);

THEN
A java.net.UnknownHostException is thrown when I request a SSL connection from the browser:

10:30:28,758 DEBUG HttpConnection:990 - EXCEPTION
EOFException()
at
org.browsermob.proxy.jetty.http.HttpRequest.readHeader(HttpRequest.java:
222)
at
org.browsermob.proxy.jetty.http.HttpConnection.readRequest(HttpConnection.java:
861)
at
org.browsermob.proxy.jetty.http.HttpConnection.handleNext(HttpConnection.java:
907)
at
org.browsermob.proxy.jetty.http.HttpConnection.handle(HttpConnection.java:
832)
at
org.browsermob.proxy.jetty.http.SocketListener.handleConnection(SocketListener.java:
245)
at
org.browsermob.proxy.jetty.util.ThreadedServer.handle(ThreadedServer.java:
357)
at org.browsermob.proxy.jetty.util.ThreadPool
$PoolThread.run(ThreadPool.java:534)
10:30:28,793 INFO JavaScriptErrorHuntingSmokeTest:? - Testing
testOpenHomePage: https://www.pcisecuritystandards.org/
10:30:28,793 INFO JavaScriptErrorHuntingSmokeTest:? - Testing
testOpenHomePage: https://www.pcisecuritystandards.org/
10:30:28,802 DEBUG HttpConnection:110 - new HttpConnection:
Socket[addr=/127.0.0.1,port=64962,localport=4449]
10:30:28,802 DEBUG HttpConnection:973 - REQUEST from
SocketListener0@0.0.0.0:4449:
CONNECT www.pcisecuritystandards.org:443 HTTP/1.1
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20100101
Firefox/8.0
Proxy-Connection: keep-alive
Host: www.pcisecuritystandards.org

10:30:28,802 DEBUG HttpServer:876 - Contexts at www.pcisecuritystandards.org:443:
[/=[HttpContext[/,/]]]
10:30:28,802 DEBUG HttpServer:890 - Try HttpContext[/,/],0
10:30:28,803 DEBUG HttpContext:1508 - Handler
org.browsermob.proxy.BrowserMobProxyHandler in HttpContext[/,/]
10:30:28,803 DEBUG HttpContext:1513 - Handled by
org.browsermob.proxy.BrowserMobProxyHandler in HttpContext[/,/]
10:30:28,803 DEBUG HttpInputStream:231 - resetStream()
10:30:28,804 DEBUG HttpConnection:1077 - RESPONSE:
HTTP/1.1 500 java%2Enet%2EUnknownHostException%3A+www
%2Epcisecuritystandards%2Eorg
Date: Fri, 02 Dec 2011 09:30:28 GMT
Server: Jetty/5.1.x (Windows 7/6.1 amd64 java/1.6.0_29
Connection: close
Content-Type: text/html
Content-Length: 1342