From 2f8ddbd724d8feb6a0b14d83405570bc9c0816db Mon Sep 17 00:00:00 2001 From: tlenz Date: Wed, 1 Mar 2017 13:53:14 +0100 Subject: add TSL client re-initialization process --- .../java/at/gv/egovernment/moa/spss/tsl/TSLServiceFactory.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'moaSig') diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/tsl/TSLServiceFactory.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/tsl/TSLServiceFactory.java index 223361d..6463745 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/tsl/TSLServiceFactory.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/tsl/TSLServiceFactory.java @@ -13,12 +13,13 @@ import iaik.pki.store.truststore.TrustStoreFactory; public class TSLServiceFactory { private static ITslService tslClient = null; - + private static TslConfigurationImpl interalConfig; public static void initialize(TslConfigurationImpl config) { if (tslClient == null) { try { - tslClient = TslClientFactory.buildTslService(config ); + interalConfig = config; + tslClient = TslClientFactory.buildTslService(interalConfig); TrustStoreFactory.addTrustStoreHandler(new ChainingTrustStoreHandler()); @@ -44,6 +45,11 @@ public class TSLServiceFactory { } public static ITslService getTSLServiceClient() { + if (!isInitialized()) { + Logger.warn("TSL client is not initialized but config is available. Starting new initialization process ..."); + initialize(interalConfig); + } + return tslClient; } -- cgit v1.2.3