diff options
Diffstat (limited to 'eaaf_core_utils/src/test')
| -rw-r--r-- | eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/test/http/HttpClientFactoryTest.java | 27 | 
1 files changed, 12 insertions, 15 deletions
| diff --git a/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/test/http/HttpClientFactoryTest.java b/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/test/http/HttpClientFactoryTest.java index 140c74f5..72ec7008 100644 --- a/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/test/http/HttpClientFactoryTest.java +++ b/eaaf_core_utils/src/test/java/at/gv/egiz/eaaf/core/test/http/HttpClientFactoryTest.java @@ -332,30 +332,27 @@ public class HttpClientFactoryTest {    @Test    public void getCustomClientX509AuthWithHsmFacade() throws EaafException, ClientProtocolException,        IOException, KeyStoreException { -    final HttpClientConfiguration config = new HttpClientConfiguration("jUnit"); -    config.setAuthMode("ssl"); -    config.buildKeyStoreConfig( -        "hsmfacade", -        null, -        null, -        "authhandler"); -    config.setSslKeyPassword("password"); -    config.setSslKeyAlias("authhandler-sign"); -    config.setDisableTlsHostCertificateValidation(true); +    final HttpClientConfiguration clientConfig = new HttpClientConfiguration("jUnit-client"); +    clientConfig.setAuthMode("ssl"); +    clientConfig.buildKeyStoreConfig("hsmfacade", null, null, "authhandler"); +    clientConfig.setSslKeyAlias("authhandler-sign"); +    clientConfig.setDisableTlsHostCertificateValidation(true); -    final CloseableHttpClient client = httpClientFactory.getHttpClient(config); +     +     +    final CloseableHttpClient client = httpClientFactory.getHttpClient(clientConfig);      Assert.assertNotNull("httpClient", client);      //set-up mock-up web-server with SSL client authentication      final Pair<KeyStore, Provider> sslClientKeyStore = -        keyStoreFactory.buildNewKeyStore(config.getKeyStoreConfig()); +        keyStoreFactory.buildNewKeyStore(clientConfig.getKeyStoreConfig()); +    X509Certificate clientRootCert = (X509Certificate) sslClientKeyStore.getFirst() +            .getCertificateChain(clientConfig.getSslKeyAlias())[1]; +      final String localhost = InetAddress.getByName("localhost").getCanonicalHostName();      final HeldCertificate localhostCertificate = new HeldCertificate.Builder()          .addSubjectAlternativeName(localhost)          .build(); -    X509Certificate clientRootCert = (X509Certificate) sslClientKeyStore.getFirst() -        .getCertificateChain(config.getSslKeyAlias())[1]; -              final HandshakeCertificates serverCertificates = new HandshakeCertificates.Builder()          .addTrustedCertificate(clientRootCert)          .heldCertificate(localhostCertificate) | 
