public String[] getEnabledCipherSuites() { return delegate.getEnabledCipherSuites(); }
if (SysProperties.ENABLE_ANONYMOUS_TLS) { String[] list = enableAnonymous( secureSocket.getEnabledCipherSuites(), secureSocket.getSupportedCipherSuites()); secureSocket.setEnabledCipherSuites(list);
public String[] getDefaultCipherSuites() { return delegate.getEnabledCipherSuites(); }
@Test(timeout = 5000) public void testCreateSSLServerSocketWithoutPort() throws Exception { setCustomCipherSuites(); SSLServerSocket sslServerSocket = x509Util.createSSLServerSocket(); Assert.assertArrayEquals(customCipherSuites, sslServerSocket.getEnabledCipherSuites()); Assert.assertTrue(sslServerSocket.getNeedClientAuth()); }
@Test(timeout = 5000) public void testCreateSSLServerSocketWithPort() throws Exception { int port = PortAssignment.unique(); setCustomCipherSuites(); SSLServerSocket sslServerSocket = x509Util.createSSLServerSocket(port); Assert.assertEquals(sslServerSocket.getLocalPort(), port); Assert.assertArrayEquals(customCipherSuites, sslServerSocket.getEnabledCipherSuites()); Assert.assertTrue(sslServerSocket.getNeedClientAuth()); }
/** * Select protocols and cipher suites to be used * based on configured inclusion and exclusion lists * as well as enabled and supported protocols and cipher suites. * * Adapted from Jetty SslContextFactory.java * * @since 0.9.16 */ public static void setProtocolsAndCiphers(SSLServerSocket socket) { String[] p = selectProtocols(socket.getEnabledProtocols(), socket.getSupportedProtocols()); for (int i = 0; i < p.length; i++) { // if we left SSLv3 in there, we don't support TLS, // so we should't remove the SSL ciphers if (p[i].equals("SSLv3")) return; } socket.setEnabledProtocols(p); socket.setEnabledCipherSuites(selectCipherSuites(socket.getEnabledCipherSuites(), socket.getSupportedCipherSuites())); }
public String[] getDefaultCipherSuites() { return delegate.getEnabledCipherSuites(); }
public String[] getDefaultCipherSuites() { return delegate.getEnabledCipherSuites(); }
public String[] getDefaultCipherSuites() { return delegate.getEnabledCipherSuites(); }
public String[] getEnabledCipherSuites() { return delegate.getEnabledCipherSuites(); }
public String[] getDefaultCipherSuites() { return delegate.getEnabledCipherSuites(); }
public String[] getDefaultCipherSuites() { return delegate.getEnabledCipherSuites(); }
public String[] getDefaultCipherSuites() { return delegate.getEnabledCipherSuites(); }
public String[] getEnabledCipherSuites() { return ss.getEnabledCipherSuites(); }
@Test public void testCipherSuitesFromConfigFile() throws Exception { File configFile = createDefaultConfigFile(); try { TlsConfiguration tlsConfiguration = new TlsConfiguration(DEFAULT_KEYSTORE); tlsConfiguration.initialise(true, JSSE_NAMESPACE); SSLSocket socket = (SSLSocket) tlsConfiguration.getSocketFactory().createSocket(); SSLServerSocket serverSocket = (SSLServerSocket) tlsConfiguration.getServerSocketFactory().createServerSocket(); assertArrayEquals(new String[] {SUPPORTED_CIPHER_SUITE}, socket.getEnabledCipherSuites()); assertArrayEquals(new String[] {SUPPORTED_CIPHER_SUITE}, serverSocket.getEnabledCipherSuites()); } finally { configFile.delete(); } }
public String[] getEnabledCipherSuites() { return delegate.getEnabledCipherSuites(); }
public SSLServerSocket newSslServerSocket(String host,int port,int backlog) throws IOException { SSLServerSocketFactory factory = sslContext.getServerSocketFactory(); SSLServerSocket socket = (SSLServerSocket) (host==null ? factory.createServerSocket(port, backlog): factory.createServerSocket(port, backlog, InetAddress.getByName(host))); if (sslConfig.getWantClientAuth()) socket.setWantClientAuth(sslConfig.getWantClientAuth()); if (sslConfig.getNeedClientAuth()) socket.setNeedClientAuth(sslConfig.getNeedClientAuth()); socket.setEnabledCipherSuites(selectCipherSuites(socket.getEnabledCipherSuites(), socket.getSupportedCipherSuites())); socket.setEnabledProtocols(selectProtocols(socket.getEnabledProtocols(),socket.getSupportedProtocols())); return socket; }
public SSLServerSocket newSslServerSocket(String host,int port,int backlog) throws IOException { SSLServerSocketFactory factory = sslContext.getServerSocketFactory(); SSLServerSocket socket = (SSLServerSocket) (host==null ? factory.createServerSocket(port, backlog): factory.createServerSocket(port, backlog, InetAddress.getByName(host))); if (sslConfig.getWantClientAuth()) socket.setWantClientAuth(sslConfig.getWantClientAuth()); if (sslConfig.getNeedClientAuth()) socket.setNeedClientAuth(sslConfig.getNeedClientAuth()); socket.setEnabledCipherSuites(selectCipherSuites(socket.getEnabledCipherSuites(), socket.getSupportedCipherSuites())); socket.setEnabledProtocols(selectProtocols(socket.getEnabledProtocols(),socket.getSupportedProtocols())); return socket; }
public SSLServerSocket newSslServerSocket(String host,int port,int backlog) throws IOException { SSLServerSocketFactory factory = sslContext.getServerSocketFactory(); SSLServerSocket socket = (SSLServerSocket) (host==null ? factory.createServerSocket(port, backlog): factory.createServerSocket(port, backlog, InetAddress.getByName(host))); if (sslConfig.getWantClientAuth()) socket.setWantClientAuth(sslConfig.getWantClientAuth()); if (sslConfig.getNeedClientAuth()) socket.setNeedClientAuth(sslConfig.getNeedClientAuth()); socket.setEnabledCipherSuites(selectCipherSuites(socket.getEnabledCipherSuites(), socket.getSupportedCipherSuites())); socket.setEnabledProtocols(selectProtocols(socket.getEnabledProtocols(),socket.getSupportedProtocols())); return socket; }
@Test public void testCipherSuitesFromConfigFile() throws Exception { File configFile = createDefaultConfigFile(); try { TlsConfiguration tlsConfiguration = new TlsConfiguration(DEFAULT_KEYSTORE); tlsConfiguration.initialise(true, JSSE_NAMESPACE); SSLSocket socket = (SSLSocket) tlsConfiguration.getSocketFactory().createSocket(); SSLServerSocket serverSocket = (SSLServerSocket) tlsConfiguration.getServerSocketFactory().createServerSocket(); assertArrayEquals(new String[] {SUPPORTED_CIPHER_SUITE}, socket.getEnabledCipherSuites()); assertArrayEquals(new String[] {SUPPORTED_CIPHER_SUITE}, serverSocket.getEnabledCipherSuites()); } finally { configFile.delete(); } }