Code example for SSLServerSocket

Methods: getNeedClientAuth, getWantClientAuth, setNeedClientAuth, setWantClientAuth

0
     * getWantClientAuth() method testing. 
     */ 
    public void testSetGetWantClientAuth() throws Exception { 
        SSLServerSocket ssocket = createSSLServerSocket();
 
        ssocket.setNeedClientAuth(true);
        ssocket.setWantClientAuth(false);
        assertFalse("Result does not correspond to expected",
                ssocket.getWantClientAuth());
        assertFalse("Socket did not reset its want client auth state",
                ssocket.getNeedClientAuth());
        ssocket.setNeedClientAuth(true);
        ssocket.setWantClientAuth(true);
        assertTrue("Result does not correspond to expected",
                ssocket.getWantClientAuth());
        assertFalse("Socket did not reset its want client auth state",
                ssocket.getNeedClientAuth());
    } 
 
    /** 
     * setEnableSessionCreation(boolean flag) method testing. 
     * getEnableSessionCreation() method testing.