diff options
Diffstat (limited to 'qpid/java/common')
-rw-r--r-- | qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLUtil.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLUtil.java b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLUtil.java index f23d9ae359..130ce04adc 100644 --- a/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLUtil.java +++ b/qpid/java/common/src/main/java/org/apache/qpid/transport/network/security/ssl/SSLUtil.java @@ -28,7 +28,8 @@ public class SSLUtil if (dn.contains("CN=")) { - hostname = dn.substring(3, dn.indexOf(",")); + hostname = dn.substring(3, + dn.indexOf(",") == -1? dn.length(): dn.indexOf(",")); } if (log.isDebugEnabled()) @@ -38,7 +39,8 @@ public class SSLUtil log.debug("Host Name obtained from DN : " + hostname); } - if (hostname != null && !hostname.equalsIgnoreCase(hostnameExpected)) + if (hostname != null && !(hostname.equalsIgnoreCase(hostnameExpected) || + hostname.equalsIgnoreCase(hostnameExpected + ".localdomain"))) { throw new TransportException("SSL hostname verification failed." + " Expected : " + hostnameExpected + |