mirror of https://github.com/apache/activemq.git
Allow config of enabled protocols for nio+ssl and stomp+nio+ssl etc to match the capability of the non-nio transports.
This commit is contained in:
parent
33089f3fbb
commit
1948fe41a3
|
@ -50,6 +50,7 @@ public class NIOSSLTransport extends NIOTransport {
|
|||
protected boolean needClientAuth;
|
||||
protected boolean wantClientAuth;
|
||||
protected String[] enabledCipherSuites;
|
||||
protected String[] enabledProtocols;
|
||||
|
||||
protected SSLContext sslContext;
|
||||
protected SSLEngine sslEngine;
|
||||
|
@ -106,6 +107,10 @@ public class NIOSSLTransport extends NIOTransport {
|
|||
sslEngine.setEnabledCipherSuites(enabledCipherSuites);
|
||||
}
|
||||
|
||||
if (enabledProtocols != null) {
|
||||
sslEngine.setEnabledProtocols(enabledProtocols);
|
||||
}
|
||||
|
||||
if (wantClientAuth) {
|
||||
sslEngine.setWantClientAuth(wantClientAuth);
|
||||
}
|
||||
|
@ -435,4 +440,12 @@ public class NIOSSLTransport extends NIOTransport {
|
|||
public void setEnabledCipherSuites(String[] enabledCipherSuites) {
|
||||
this.enabledCipherSuites = enabledCipherSuites;
|
||||
}
|
||||
|
||||
public String[] getEnabledProtocols() {
|
||||
return enabledProtocols;
|
||||
}
|
||||
|
||||
public void setEnabledProtocols(String[] enabledProtocols) {
|
||||
this.enabledProtocols = enabledProtocols;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,6 +90,13 @@ public class NIOSSLBasicTest {
|
|||
stopBroker(broker);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void enabledProtocols() throws Exception {
|
||||
BrokerService broker = createBroker("nio+ssl", "nio+ssl://localhost:61616?transport.needClientAuth=true&transport.enabledProtocols=TLSv1,TLSv1.1,TLSv1.2");
|
||||
basicSendReceive("ssl://localhost:" + broker.getConnectorByName("nio+ssl").getConnectUri().getPort());
|
||||
stopBroker(broker);
|
||||
}
|
||||
|
||||
public void basicSendReceive(String uri) throws Exception {
|
||||
ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(uri);
|
||||
Connection connection = factory.createConnection();
|
||||
|
|
Loading…
Reference in New Issue