mirror of
https://github.com/moparisthebest/davmail
synced 2025-01-06 03:08:02 -05:00
Use interactive console certificate accept in headless and/or server mode
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@581 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
d8eaa3bc0c
commit
41fa315b49
@ -39,7 +39,7 @@ public class DavGatewayX509TrustManager implements X509TrustManager {
|
||||
// first try standard Trust Manager
|
||||
this.standardTrustManager.checkServerTrusted(x509Certificates, authType);
|
||||
} catch (CertificateException e) {
|
||||
if ((x509Certificates != null) && (x509Certificates.length > 0) && !GraphicsEnvironment.isHeadless()) {
|
||||
if ((x509Certificates != null) && (x509Certificates.length > 0)) {
|
||||
userCheckServerTrusted(x509Certificates);
|
||||
} else {
|
||||
throw e;
|
||||
@ -65,8 +65,8 @@ public class DavGatewayX509TrustManager implements X509TrustManager {
|
||||
DavGatewayTray.debug(new BundleMessage("LOG_FOUND_ACCEPTED_CERTIFICATE", acceptedCertificateHash));
|
||||
} else {
|
||||
boolean isCertificateTrusted;
|
||||
if (Settings.getBooleanProperty("davmail.server")) {
|
||||
// headless mode
|
||||
if (Settings.getBooleanProperty("davmail.server") || GraphicsEnvironment.isHeadless()) {
|
||||
// headless or server mode
|
||||
isCertificateTrusted = isCertificateTrusted(x509Certificates[0]);
|
||||
} else {
|
||||
isCertificateTrusted = AcceptCertificateDialog.isCertificateTrusted(x509Certificates[0]);
|
||||
|
Loading…
Reference in New Issue
Block a user