1
2
3
4
5
6
7 package org.mule.api;
8
9 import org.mule.api.security.tls.TlsConfiguration;
10 import org.mule.api.security.tls.TlsPropertiesSocketFactory;
11 import org.mule.tck.junit4.AbstractMuleTestCase;
12
13 import org.junit.Test;
14
15 import static org.junit.Assert.assertTrue;
16
17 public class TlsPropertiesSocketTestCase extends AbstractMuleTestCase
18 {
19
20 @Test
21 public void testSimpleSocket() throws Exception
22 {
23 TlsConfiguration configuration = new TlsConfiguration(TlsConfiguration.DEFAULT_KEYSTORE);
24 configuration.setKeyPassword("mulepassword");
25 configuration.setKeyStorePassword("mulepassword");
26 configuration.setKeyStore("clientKeystore");
27 configuration.initialise(false, TlsConfiguration.JSSE_NAMESPACE);
28
29 TlsPropertiesSocketFactory socketFactory =
30 new TlsPropertiesSocketFactory(true, TlsConfiguration.JSSE_NAMESPACE);
31 assertTrue("socket is useless", socketFactory.getSupportedCipherSuites().length > 0);
32 }
33
34 }
35
36