diff --git a/src/net/java/sip/communicator/impl/certificate/CertificateServiceImpl.java b/src/net/java/sip/communicator/impl/certificate/CertificateServiceImpl.java index 480d812ef..38d2641c8 100644 --- a/src/net/java/sip/communicator/impl/certificate/CertificateServiceImpl.java +++ b/src/net/java/sip/communicator/impl/certificate/CertificateServiceImpl.java @@ -266,7 +266,15 @@ public void checkClientTrusted(X509Certificate[] chain, private void checkCertTrusted(X509Certificate[] chain, String authType) throws CertificateException { - if(config.getBoolean(PNAME_ALWAYS_TRUST, false)) + // check and default configurations for property + // if missing default is null - false + String defaultAlwaysTrustMode = + CertificateVerificationActivator.getResources() + .getSettingsString( + CertificateService.PNAME_ALWAYS_TRUST); + + if(config.getBoolean(PNAME_ALWAYS_TRUST, + Boolean.parseBoolean(defaultAlwaysTrustMode))) return; try diff --git a/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigPluginActivator.java b/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigPluginActivator.java index e43de08a6..5b9438778 100644 --- a/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigPluginActivator.java +++ b/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigPluginActivator.java @@ -140,7 +140,29 @@ public void start(BundleContext bc) * Wait for the first ProtocolProviderService to register in order to * start the auto-away functionality i.e. to call #startThread(). */ - bundleContext.addServiceListener(this); + ServiceReference[] protocolRefs = bundleContext.getServiceReferences( + ProtocolProviderService.class.getName(), null); + if(protocolRefs != null && protocolRefs.length > 0) + { + try + { + synchronized (GeneralConfigPluginActivator.class) + { + if (!startThreadIsCalled) + { + startThread(); + startThreadIsCalled = true; + } + } + } + catch(Throwable t) + { + // not supposed to happen + logger.error("Error starting auto away thread", t); + } + } + else + bundleContext.addServiceListener(this); if (logger.isInfoEnabled()) logger.info("PREFERENCES PLUGIN... [REGISTERED]");