use of org.apache.activemq.transport.StubTransportListener in project activemq-artemis by apache.
the class SslTransportTest method createTransportAndConsume.
private void createTransportAndConsume(boolean wantAuth, boolean needAuth) throws IOException {
JMXPrincipal principal = new JMXPrincipal(certDistinguishedName);
X509Certificate cert = new StubX509Certificate(principal);
StubSSLSession sslSession = new StubSSLSession(cert);
sslSocket = new StubSSLSocket(sslSession);
sslSocket.setWantClientAuth(wantAuth);
sslSocket.setNeedClientAuth(needAuth);
SslTransport transport = new SslTransport(new ObjectStreamWireFormat(), sslSocket);
stubListener = new StubTransportListener();
transport.setTransportListener(stubListener);
ConnectionInfo sentInfo = new ConnectionInfo();
sentInfo.setUserName(username);
sentInfo.setPassword(password);
transport.doConsume(sentInfo);
}
Aggregations