Source:
public void testProxyAuthConnection_doOutput ( ) throws java.lang.Throwable { org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.setUpStoreProperties ( ) ; java.net.ServerSocket ss = new java.net.ServerSocket ( 0 ) ; org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.TestHostnameVerifier hnv = new org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.TestHostnameVerifier ( ) ; javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier ( hnv ) ; java.net.Authenticator.setDefault ( new java.net.Authenticator ( ) { protected java.net.PasswordAuthentication getPasswordAuthentication ( ) { return new java.net.PasswordAuthentication ( "user" , "password" . toCharArray ( ) ) ; } } ) ; java.net.URL url = new java.net.URL ( "https://requested.host:55554/requested.data" ) ; javax.net.ssl.HttpsURLConnection connection = ( ( javax.net.ssl.HttpsURLConnection ) ( url.openConnection ( new java.net.Proxy ( java.net.Proxy.Type.HTTP , new java.net.InetSocketAddress ( "localhost" , ss.getLocalPort ( ) ) ) ) ) ) ; connection.setSSLSocketFactory ( org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.getContext ( ) . getSocketFactory ( ) ) ; connection.setDoOutput ( true ) ; javax.net.ssl.SSLSocket peerSocket = ( ( javax.net.ssl.SSLSocket ) ( org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.doInteraction ( connection , ss , org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.OK_CODE , true ) ) ) ; org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.checkConnectionStateParameters ( connection , peerSocket ) ; }

Target:
public void testConsequentProxyConnection ( ) throws java.lang.Throwable { org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.setUpStoreProperties ( ) ; javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier ( new org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.TestHostnameVerifier ( ) ) ; org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.SingleRequestDispatcher getDispatcher1 = new org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.SingleRequestDispatcher ( org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.GET_METHOD , org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.OK_CODE ) ; com.google.mockwebserver.MockWebServer proxyAndWebServer1 = org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.createProxiedServer ( getDispatcher1 ) ; java.net.URL proxyUrl1 = proxyAndWebServer1.getUrl ( "/" ) ; java.net.URL url = new java.net.URL ( "https://requested.host:55555/requested.data" ) ; java.net.InetSocketAddress proxyAddress = new java.net.InetSocketAddress ( "localhost" , proxyUrl1.getPort ( ) ) ; javax.net.ssl.HttpsURLConnection connection = ( ( javax.net.ssl.HttpsURLConnection ) ( url.openConnection ( new java.net.Proxy ( java.net.Proxy.Type.HTTP , proxyAddress ) ) ) ) ; connection.setSSLSocketFactory ( org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.getContext ( ) . getSocketFactory ( ) ) ; org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.executeClientRequest ( connection , false ) ; org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.checkConnectionStateParameters ( connection , getDispatcher1.getLastRequest ( ) ) ; proxyAndWebServer1.shutdown ( ) ; org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.SingleRequestDispatcher getDispatcher2 = new org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.SingleRequestDispatcher ( org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.GET_METHOD , org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.OK_CODE ) ; com.google.mockwebserver.MockWebServer proxyAndWebServer2 = org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.createProxiedServer ( getDispatcher2 ) ; java.net.URL proxyUrl2 = proxyAndWebServer2.getUrl ( "/" ) ; java.net.InetSocketAddress proxyAddress2 = new java.net.InetSocketAddress ( "localhost" , proxyUrl2.getPort ( ) ) ; javax.net.ssl.HttpsURLConnection connection2 = ( ( javax.net.ssl.HttpsURLConnection ) ( url.openConnection ( new java.net.Proxy ( java.net.Proxy.Type.HTTP , proxyAddress2 ) ) ) ) ; connection2.setSSLSocketFactory ( org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.getContext ( ) . getSocketFactory ( ) ) ; org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.executeClientRequest ( connection2 , false ) ; org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.checkConnectionStateParameters ( connection2 , getDispatcher2.getLastRequest ( ) ) ; proxyAndWebServer2.shutdown ( ) ; }