Fix starting auto away thread.

Check for always trust mode in default settings in Certificate Service.
cusax-fix
Damian Minkov 15 years ago
parent 3f6a6d394d
commit bbb7ea155d

@ -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

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

Loading…
Cancel
Save