use of org.mule.runtime.core.privileged.security.tls.TlsConfiguration in project mule by mulesoft.
the class TlsConfigurationTestCase method testSimpleSocket.
@Test
public void testSimpleSocket() throws Exception {
TlsConfiguration configuration = new TlsConfiguration(DEFAULT_KEYSTORE);
configuration.setKeyPassword("mulepassword");
configuration.setKeyStorePassword("mulepassword");
configuration.setKeyStore("clientKeystore");
configuration.initialise(false, JSSE_NAMESPACE);
SSLSocketFactory socketFactory = configuration.getSocketFactory();
assertTrue("socket is useless", socketFactory.getSupportedCipherSuites().length > 0);
}
use of org.mule.runtime.core.privileged.security.tls.TlsConfiguration in project mule by mulesoft.
the class TlsConfigurationTestCase method defaultProtocol.
@Test
public void defaultProtocol() throws Exception {
TlsConfiguration tlsConfiguration = new TlsConfiguration(DEFAULT_KEYSTORE);
tlsConfiguration.initialise(true, JSSE_NAMESPACE);
SSLSocketFactory socketFactory = tlsConfiguration.getSocketFactory();
SSLServerSocketFactory serverSocketFactory = tlsConfiguration.getServerSocketFactory();
SSLContext sslContext = SSLContext.getInstance(DEFAULT_SSL_TYPE);
sslContext.init(null, null, null);
assertThat(socketFactory.getDefaultCipherSuites(), arrayContainingInAnyOrder(sslContext.getSocketFactory().getDefaultCipherSuites()));
}
Aggregations