test/sun/net/www/protocol/https/NewImpl/ComHostnameVerifier.java

Print this page

        

*** 184,193 **** --- 184,204 ---- sslSocket.close(); serverReady = false; } } + private static class ComSunHTTPSHandlerFactory implements URLStreamHandlerFactory { + private static String SUPPORTED_PROTOCOL = "https"; + + public URLStreamHandler createURLStreamHandler(String protocol) { + if (!protocol.equalsIgnoreCase(SUPPORTED_PROTOCOL)) + return null; + + return new com.sun.net.ssl.internal.www.protocol.https.Handler(); + } + } + /* * Define the client side of the test. * * If the server prematurely exits, serverReady will be set to true * to avoid infinite hangs.
*** 198,209 **** */ while (!serverReady) { Thread.sleep(50); } ! System.setProperty("java.protocol.handler.pkgs", ! "com.sun.net.ssl.internal.www.protocol"); System.setProperty("https.cipherSuites", "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA"); // use the default hostname verifier --- 209,219 ---- */ while (!serverReady) { Thread.sleep(50); } ! URL.addURLStreamHandlerFactory(new ComSunHTTPSHandlerFactory()); System.setProperty("https.cipherSuites", "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA"); // use the default hostname verifier