Search in sources :

Example 1 with StubSSLServerSocket

use of org.apache.activemq.transport.tcp.StubSSLServerSocket in project activemq-artemis by apache.

the class JaasDualAuthenticationBrokerTest method setUp.

@Override
protected void setUp() throws Exception {
    receiveBroker = new StubBroker();
    authBroker = new JaasDualAuthenticationBroker(receiveBroker, "activemq-domain", "activemq-ssl-domain");
    connectionContext = new ConnectionContext();
    SSLServerSocket sslServerSocket = new StubSSLServerSocket();
    StubSSLSocketFactory socketFactory = new StubSSLSocketFactory(sslServerSocket);
    try {
        sslTransportServer = new SslTransportServer(null, new URI("ssl://localhost:61616?needClientAuth=true"), socketFactory);
    } catch (Exception e) {
        fail("Unable to create SslTransportServer.");
    }
    sslTransportServer.setNeedClientAuth(true);
    sslTransportServer.bind();
    try {
        nonSslTransportServer = new TcpTransportServer(null, new URI("tcp://localhost:61613"), socketFactory);
    } catch (Exception e) {
        fail("Unable to create TcpTransportServer.");
    }
    connectionInfo = new ConnectionInfo();
    createLoginConfig();
}
Also used : StubSSLServerSocket(org.apache.activemq.transport.tcp.StubSSLServerSocket) ConnectionContext(org.apache.activemq.broker.ConnectionContext) SslTransportServer(org.apache.activemq.transport.tcp.SslTransportServer) ConnectionInfo(org.apache.activemq.command.ConnectionInfo) StubSSLServerSocket(org.apache.activemq.transport.tcp.StubSSLServerSocket) SSLServerSocket(javax.net.ssl.SSLServerSocket) TcpTransportServer(org.apache.activemq.transport.tcp.TcpTransportServer) URI(java.net.URI) StubSSLSocketFactory(org.apache.activemq.transport.tcp.StubSSLSocketFactory) StubBroker(org.apache.activemq.broker.StubBroker)

Aggregations

URI (java.net.URI)1 SSLServerSocket (javax.net.ssl.SSLServerSocket)1 ConnectionContext (org.apache.activemq.broker.ConnectionContext)1 StubBroker (org.apache.activemq.broker.StubBroker)1 ConnectionInfo (org.apache.activemq.command.ConnectionInfo)1 SslTransportServer (org.apache.activemq.transport.tcp.SslTransportServer)1 StubSSLServerSocket (org.apache.activemq.transport.tcp.StubSSLServerSocket)1 StubSSLSocketFactory (org.apache.activemq.transport.tcp.StubSSLSocketFactory)1 TcpTransportServer (org.apache.activemq.transport.tcp.TcpTransportServer)1