aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/crypto/XmppDomainVerifier.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/pixart/messenger/crypto/XmppDomainVerifier.java')
-rw-r--r--src/main/java/de/pixart/messenger/crypto/XmppDomainVerifier.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main/java/de/pixart/messenger/crypto/XmppDomainVerifier.java b/src/main/java/de/pixart/messenger/crypto/XmppDomainVerifier.java
index 97b3733b6..e811a0f39 100644
--- a/src/main/java/de/pixart/messenger/crypto/XmppDomainVerifier.java
+++ b/src/main/java/de/pixart/messenger/crypto/XmppDomainVerifier.java
@@ -43,10 +43,9 @@ public class XmppDomainVerifier implements DomainHostnameVerifier {
}
X509Certificate certificate = (X509Certificate) chain[0];
final List<String> commonNames = getCommonNames(certificate);
- final boolean isSelfSignedCertificate = isSelfSigned(certificate);
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT || isSelfSignedCertificate) {
- if (commonNames.size() == 1 && commonNames.get(0).equals(domain)) {
- Log.d(LOGTAG, "accepted CN in cert as work around for " + domain + " isSelfSigned=" + Boolean.toString(isSelfSignedCertificate) + ", sdkInt=" + Build.VERSION.SDK_INT);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && isSelfSigned(certificate)) {
+ if (commonNames.size() == 1 && matchDomain(domain, commonNames)) {
+ Log.d(LOGTAG, "accepted CN in self signed cert as work around for " + domain);
return true;
}
}