diff options
Diffstat (limited to 'eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/test/http/HttpClientFactoryProdHostTest.java')
-rw-r--r-- | eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/test/http/HttpClientFactoryProdHostTest.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/test/http/HttpClientFactoryProdHostTest.java b/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/test/http/HttpClientFactoryProdHostTest.java index 85fa6129..73a14c45 100644 --- a/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/test/http/HttpClientFactoryProdHostTest.java +++ b/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/test/http/HttpClientFactoryProdHostTest.java @@ -6,15 +6,18 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; +import java.security.Security; import java.security.UnrecoverableKeyException; import java.security.cert.CertificateEncodingException; +import org.apache.commons.lang3.RandomStringUtils; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.util.EntityUtils; +import org.bouncycastle.jsse.provider.BouncyCastleJsseProvider; import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; @@ -46,9 +49,11 @@ public class HttpClientFactoryProdHostTest { */ @BeforeClass public static void classInitializer() { - final Logger logger = (Logger) LoggerFactory.getLogger("org.bouncycastle.jsse"); - logger.setLevel(Level.TRACE); - + final Logger logger = (Logger) LoggerFactory.getLogger("org.bouncycastle.jsse"); + // do not set log-level to trace, because otherwise you get a NullPointerException from BCJSSE Provider + logger.setLevel(Level.INFO); + + Security.removeProvider(BouncyCastleJsseProvider.PROVIDER_NAME); System.setProperty("org.bouncycastle.jsse.client.acceptRenegotiation", "true"); } @@ -69,7 +74,8 @@ public class HttpClientFactoryProdHostTest { CertificateEncodingException { System.setProperty("javax.net.debug", "ssl:handshake"); - final HttpClientConfiguration clientConfig = new HttpClientConfiguration("jUnit-client"); + final HttpClientConfiguration clientConfig = new HttpClientConfiguration( + "jUnit-client-" + RandomStringUtils.randomAlphabetic(5)); clientConfig.setAuthMode("ssl"); clientConfig.buildKeyStoreConfig("hsmfacade", null, null, "authhandler"); clientConfig.setSslKeyAlias("authhandler-mis"); |