Commit 38a671e8 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Added checking if certificate validation is disabled for s2s when using SASL EXTERNAL. JM-604

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3599 b35dd754-fafc-0310-a699-88a17e54d16e
parent 692d9aaf
...@@ -301,6 +301,17 @@ public class SASLAuthentication { ...@@ -301,6 +301,17 @@ public class SASLAuthentication {
if (hostname != null && hostname.length() > 0) { if (hostname != null && hostname.length() > 0) {
hostname = StringUtils.decodeBase64(hostname); hostname = StringUtils.decodeBase64(hostname);
// Check if cerificate validation is disabled for s2s
if (session instanceof IncomingServerSession) {
// Flag that indicates if certificates of the remote server should be validated.
// Disabling certificate validation is not recommended for production environments.
boolean verify =
JiveGlobals.getBooleanProperty("xmpp.server.certificate.verify", true);
if (!verify) {
authenticationSuccessful(hostname);
return true;
}
}
// Check that hostname matches the one provided in a certificate // Check that hostname matches the one provided in a certificate
for (Certificate certificate : connection.getSSLSession().getPeerCertificates()) { for (Certificate certificate : connection.getSSLSession().getPeerCertificates()) {
if (TLSStreamHandler.getPeerIdentities((X509Certificate) certificate) if (TLSStreamHandler.getPeerIdentities((X509Certificate) certificate)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment