Adds option to disable custom digest-md5 mechanism.

cusax-fix
Damian Minkov 13 years ago
parent a035f2c7ee
commit fa73ab5bc2

@ -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);

@ -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));

Loading…
Cancel
Save