mirror of
https://github.com/apache/cloudstack
synced 2026-08-02 05:26:35 +00:00
use a preferable protocol that works on jvm 1.6
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
1ef12f4145
commit
f5f6c2d1a7
@ -47,7 +47,7 @@ public class RabbitMQEventBus extends ManagerBase implements EventBus {
|
||||
private static Integer port;
|
||||
private static String username;
|
||||
private static String password;
|
||||
private static String secureProtocol = "TLSv1.2";
|
||||
private static String secureProtocol = "TLSv1";
|
||||
|
||||
public static void setVirtualHost(String virtualHost) {
|
||||
RabbitMQEventBus.virtualHost = virtualHost;
|
||||
|
||||
@ -48,9 +48,6 @@ public class SocketWrapperImpl extends PipelineImpl implements SocketWrapper {
|
||||
|
||||
protected SSLSocket sslSocket;
|
||||
|
||||
protected String SSL_VERSION_TO_USE = "TLSv1.2";
|
||||
//protected String SSL_VERSION_TO_USE = "SSLv3";
|
||||
|
||||
protected SSLState sslState;
|
||||
|
||||
public SocketWrapperImpl(String id, SSLState sslState) {
|
||||
@ -135,7 +132,7 @@ public class SocketWrapperImpl extends PipelineImpl implements SocketWrapper {
|
||||
// Use most secure implementation of SSL available now.
|
||||
// JVM will try to negotiate TLS1.2, then will fallback to TLS1.0, if
|
||||
// TLS1.2 is not supported.
|
||||
SSLContext sslContext = SSLContext.getInstance(SSL_VERSION_TO_USE);
|
||||
SSLContext sslContext = SSLUtils.getSSLContext();
|
||||
|
||||
// Trust all certificates (FIXME: insecure)
|
||||
sslContext.init(null, new TrustManager[] {new TrustAllX509TrustManager(sslState)}, null);
|
||||
|
||||
@ -42,10 +42,10 @@ public class SSLUtils {
|
||||
}
|
||||
|
||||
public static SSLContext getSSLContext() throws NoSuchAlgorithmException {
|
||||
return SSLContext.getInstance("TLSv1.2");
|
||||
return SSLContext.getInstance("TLSv1");
|
||||
}
|
||||
|
||||
public static SSLContext getSSLContext(String provider) throws NoSuchAlgorithmException, NoSuchProviderException {
|
||||
return SSLContext.getInstance("TLSv1.2", provider);
|
||||
return SSLContext.getInstance("TLSv1", provider);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user