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:
mguessan 2009-06-09 21:54:24 +00:00
parent d8eaa3bc0c
commit 41fa315b49
1 changed files with 3 additions and 3 deletions

View File

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