< prev index next >

test/jdk/sun/net/www/protocol/https/ChunkedOutputStream.java

Print this page

        

@@ -136,10 +136,21 @@
         } catch (IOException e) {
             e.printStackTrace();
         }
     }
 
+    public boolean closeOnException(Exception ex) {
+        if (ex instanceof SSLException) {
+            if (ex.toString().contains("Unrecognized SSL message, plaintext connection?")) {
+                System.out.println("TestHttpsServer receveived rogue connection: " + ex);
+                System.out.println("Ignoring rogue connection...");
+                return true;
+            }
+        }
+        return false;
+    }
+
     static void readAndCompare(InputStream is, String cmp) throws IOException {
         int c;
         byte buf[] = new byte[1024];
         int off = 0;
         int len = 1024;
< prev index next >