8171043: ServerIdentityTest.java fails on Windows
authormli
Mon, 12 Dec 2016 17:40:54 -0800
changeset 42668 9518a1858a96
parent 42667 e058e6cdb4cf
child 42669 0b8c4fd7cc85
8171043: ServerIdentityTest.java fails on Windows Summary: Before sending response, the server has to read the request. Reviewed-by: xuelei Contributed-by: John Jiang <sha.jiang@oracle.com>
jdk/test/ProblemList.txt
jdk/test/sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java
--- a/jdk/test/ProblemList.txt	Mon Dec 12 17:29:46 2016 -0800
+++ b/jdk/test/ProblemList.txt	Mon Dec 12 17:40:54 2016 -0800
@@ -219,8 +219,6 @@
 
 sun/security/ssl/SSLSocketImpl/AsyncSSLSocketClose.java         8161232 macosx-all
 
-sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java  8171043 windows-all
-
 ############################################################################
 
 # jdk_sound
--- a/jdk/test/sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java	Mon Dec 12 17:29:46 2016 -0800
+++ b/jdk/test/sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java	Mon Dec 12 17:40:54 2016 -0800
@@ -43,6 +43,7 @@
 import java.io.OutputStreamWriter;
 import java.net.HttpURLConnection;
 import java.net.URL;
+
 import javax.net.ssl.HttpsURLConnection;
 import javax.net.ssl.SSLContext;
 import javax.net.ssl.SSLSocket;
@@ -70,6 +71,8 @@
 
     @Override
     protected void runServerApplication(SSLSocket socket) throws Exception {
+        InputStream sslIS = socket.getInputStream();
+        sslIS.read();
         BufferedWriter bw = new BufferedWriter(
                 new OutputStreamWriter(socket.getOutputStream()));
         bw.write("HTTP/1.1 200 OK\r\n\r\n\r\n");