Code example for SSLServerSocket

Methods: getEnabledCipherSuites, getSupportedCipherSuites, setEnabledCipherSuites

0
     * javax.net.ssl.SSLServerSocket#setEnabledCipherSuites(String[] suites) 
     */ 
    public void test_EnabledCipherSuites() throws Exception { 
        SSLServerSocket sss = getSSLServerSocket();
        try { 
            sss.setEnabledCipherSuites(null);
        } catch (IllegalArgumentException iae) {
            //expected 
        } 
        String[] unsupportedCipherSuites = {"unsupported"};
        try { 
            sss.setEnabledCipherSuites(unsupportedCipherSuites);
        } catch (IllegalArgumentException iae) {
            //expected 
        } 
        int count = sss.getSupportedCipherSuites().length;
        assertTrue("No supported cipher suites", count > 0);
        sss.setEnabledCipherSuites(sss.getSupportedCipherSuites());
        String[] res = sss.getEnabledCipherSuites();
        assertNotNull("NULL result", res);
        assertEquals("not all supported cipher suites were enabled",
                     Arrays.asList(sss.getSupportedCipherSuites()),
                     Arrays.asList(res));
    } 
 
    /** 
     * @throws IOException