Code example for HttpsURLConnection

Methods: getSSLSocketFactory

0
        } 
    } 
 
    public final void testGetSSLSocketFactory() { 
        HttpsURLConnection con = new MyHttpsURLConnection(null);
        SSLSocketFactory sf = con.getSSLSocketFactory();
        if (!sf.equals(SSLSocketFactory.getDefault())) {
            fail("incorrect DefaultSSLSocketFactory");
        } 
    } 
 
    public final void testSetDefaultSSLSocketFactory() { 
        try { 
            HttpsURLConnection.setDefaultSSLSocketFactory(null);
            fail("No expected IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        } 
    } 
 
    public final void testSetSSLSocketFactory() {