Code example for SSLSession

Methods: getPeerHost, getPeerPort

0
     * javax.net.ssl.SSLSession#getPeerHost() 
     * javax.net.ssl.SSLSession#getPeerPort() 
     */ 
    public void test_getPeerHost() throws Exception { 
        SSLSession s = clientSession;
        assertEquals(InetAddress.getLocalHost().getHostName(), s.getPeerHost());
        assertEquals(port, s.getPeerPort());
    } 
 
    /** 
     * javax.net.ssl.SSLSession#invalidate() 
     * javax.net.ssl.SSLSession#isValid() 
     */ 
    public void test_invalidate() { 
        SSLSession s = clientSession;
        assertTrue(s.isValid());
        s.invalidate();
        assertFalse(s.isValid());
    } 
 
    /**