diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java index 6ec2770de..f00d86e8b 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java @@ -1247,10 +1247,18 @@ else if (tlsRequired) // Insert our sasl mechanism implementation // in order to support some incompatible servers - SASLAuthentication.unregisterSASLMechanism("DIGEST-MD5"); - SASLAuthentication.registerSASLMechanism("DIGEST-MD5", - SASLDigestMD5Mechanism.class); - SASLAuthentication.supportSASLMechanism("DIGEST-MD5"); + boolean disableCustomDigestMD5 + = accountID.getAccountPropertyBoolean( + "DISABLE_CUSTOM_DIGEST_MD5", + false); + + if(!disableCustomDigestMD5) + { + SASLAuthentication.unregisterSASLMechanism("DIGEST-MD5"); + SASLAuthentication.registerSASLMechanism("DIGEST-MD5", + SASLDigestMD5Mechanism.class); + SASLAuthentication.supportSASLMechanism("DIGEST-MD5"); + } connection.login(userName, password, resource); diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/sasl/SASLDigestMD5Mechanism.java b/src/net/java/sip/communicator/impl/protocol/jabber/sasl/SASLDigestMD5Mechanism.java index 552d797f4..4ee652fed 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/sasl/SASLDigestMD5Mechanism.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/sasl/SASLDigestMD5Mechanism.java @@ -99,13 +99,13 @@ public void challengeReceived(String challenge) response = sc.evaluateChallenge(null); } - String authenticationText = null; - if(null != response) { - authenticationText = Base64.encodeBytes(response,Base64.DONT_BREAK_LINES); - } - if((null == authenticationText) || (authenticationText.equals(""))) { - authenticationText = "="; - } + String authenticationText = null; + if(null != response) { + authenticationText = Base64.encodeBytes(response,Base64.DONT_BREAK_LINES); + } + if((null == authenticationText) || (authenticationText.equals(""))) { + authenticationText = "="; + } // Send the authentication to the server getSASLAuthentication().send(new Response(authenticationText));