Code example for SSLSocket

Methods: close

0
        SslRMIServerSocketFactory factorySrv = new SslRMIServerSocketFactory();
 
        ServerSocket ssocket = factorySrv.createServerSocket(0);
        SSLSocket csocket = (SSLSocket) factoryCln.createSocket("localhost",
                ssocket.getLocalPort());
        csocket.close();
        ssocket.close();
 
        String old = System
                .getProperty("javax.rmi.ssl.client.enabledCipherSuites");
        try { 
            System.setProperty("javax.rmi.ssl.client.enabledCipherSuites",
                    "Incorrect"); 
            ssocket = factorySrv.createServerSocket(0);
            try { 
                factoryCln.createSocket("localhost", ssocket.getLocalPort());
                fail("No expected IOException");
            } catch (IOException e) {
            } 
            ssocket.close();
        } finally {