diff --git a/luni/src/test/java/libcore/java/net/URLConnectionTest.java b/luni/src/test/java/libcore/java/net/URLConnectionTest.java
index f664b08..c09939f 100644
--- a/luni/src/test/java/libcore/java/net/URLConnectionTest.java
+++ b/luni/src/test/java/libcore/java/net/URLConnectionTest.java
@@ -642,42 +642,32 @@
      * Tolerate bad https proxy response when using HttpResponseCache. http://b/6754912
      */
     public void testConnectViaHttpProxyToHttpsUsingBadProxyAndHttpResponseCache() throws Exception {
-        ProxyConfig proxyConfig = ProxyConfig.PROXY_SYSTEM_PROPERTY;
-
         TestSSLContext testSSLContext = TestSSLContext.create();
 
         initResponseCache();
 
         server.useHttps(testSSLContext.serverContext.getSocketFactory(), true);
+
+        // The inclusion of a body in the response to the CONNECT is key to reproducing b/6754912.
         MockResponse badProxyResponse = new MockResponse()
                 .setSocketPolicy(SocketPolicy.UPGRADE_TO_SSL_AT_END)
                 .clearHeaders()
-                .setBody("bogus proxy connect response content"); // Key to reproducing b/6754912
+                .setBody("bogus proxy connect response content");
 
-        // We enqueue the bad response twice because the connection will
-        // be retried with TLS_MODE_COMPATIBLE after the first connection
-        // fails.
         server.enqueue(badProxyResponse);
-        server.enqueue(badProxyResponse);
+        server.enqueue(new MockResponse().setBody("response"));
 
         server.play();
 
         URL url = new URL("https://android.com/foo");
+        ProxyConfig proxyConfig = ProxyConfig.PROXY_SYSTEM_PROPERTY;
         HttpsURLConnection connection = (HttpsURLConnection) proxyConfig.connect(server, url);
         connection.setSSLSocketFactory(testSSLContext.clientContext.getSocketFactory());
-
-        try {
-            connection.connect();
-            fail();
-        } catch (SSLHandshakeException expected) {
-            // Thrown when the connect causes SSLSocket.startHandshake() to throw
-            // when it sees the "bogus proxy connect response content"
-            // instead of a ServerHello handshake message.
-        }
+        connection.setHostnameVerifier(new RecordingHostnameVerifier());
+        assertContent("response", connection);
 
         RecordedRequest connect = server.takeRequest();
-        assertEquals("Connect line failure on proxy",
-                "CONNECT android.com:443 HTTP/1.1", connect.getRequestLine());
+        assertEquals("CONNECT android.com:443 HTTP/1.1", connect.getRequestLine());
         assertContains(connect.getHeaders(), "Host: android.com");
     }
 
