mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-27 16:33:47 +00:00
Show subject DN
This commit is contained in:
parent
0c959346bf
commit
3b1dded8c2
1 changed files with 10 additions and 1 deletions
|
@ -26,6 +26,7 @@ import java.net.UnknownHostException;
|
|||
import java.security.GeneralSecurityException;
|
||||
import java.security.KeyStore;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.Principal;
|
||||
import java.security.cert.CertificateEncodingException;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.CertificateParsingException;
|
||||
|
@ -491,7 +492,15 @@ public class MailService implements AutoCloseable {
|
|||
}
|
||||
|
||||
// Check certificates
|
||||
rtm.checkServerTrusted(chain, authType);
|
||||
try {
|
||||
rtm.checkServerTrusted(chain, authType);
|
||||
} catch (CertificateException ex) {
|
||||
Principal principal = certificate.getSubjectDN();
|
||||
if (principal == null)
|
||||
throw ex;
|
||||
else
|
||||
throw new CertificateException(principal.getName(), ex);
|
||||
}
|
||||
|
||||
// Check host name
|
||||
List<String> names = getDnsNames(certificate);
|
||||
|
|
Loading…
Reference in a new issue