Source:
<code>public void testClientConfigProviderSSLContextIgnoredIfDifferentIsSet() throws URISyntaxException, GeneralSecurityException { AuthenticationContextConfigurationClient AUTH_CONTEXT_CLIENT = AccessController.doPrivileged((PrivilegedAction<AuthenticationContextConfigurationClient>) AuthenticationContextConfigurationClient::new); AuthenticationContext context = doPrivileged((PrivilegedAction<AuthenticationContext>) () -> { try { URL config = getClass().getResource("wildfly-config-correct-truststore-missing.xml"); return ElytronXmlParser.parseAuthenticationClientConfiguration(config.toURI()).create(); } catch (Throwable t) { throw new InvalidAuthenticationConfigurationException(t); } }); AuthenticationContext contextWithTruststore = doPrivileged((PrivilegedAction<AuthenticationContext>) () -> { try { URL config = getClass().getResource("wildfly-config-correct-truststore.xml"); return ElytronXmlParser.parseAuthenticationClientConfiguration(config.toURI()).create(); } catch (Throwable t) { throw new InvalidAuthenticationConfigurationException(t); } }); <START> SSLContext sslContext = AUTH_CONTEXT_CLIENT.getSSLContext(new URI(securedRootUrl.getHost()), contextWithTruststore); <END> context.run(() -> { ResteasyClientBuilder resteasyClientBuilder = (ResteasyClientBuilder) ClientBuilder.newBuilder(); resteasyClientBuilder.sslContext(sslContext).hostnameVerifier((s, sslSession) -> true); ResteasyClient client = resteasyClientBuilder.build(); Response response = client.target(String.valueOf(securedRootUrl)).request().get(); Assert.assertEquals(200, response.getStatus()); }); }</code><technical_language>returned URL.getHost() is valid input new URI(String str)</technical_language>

Target:
public void testClientConfigProviderSSLContextIgnoredIfDifferentIsSet() throws URISyntaxException, GeneralSecurityException { AuthenticationContextConfigurationClient AUTH_CONTEXT_CLIENT = AccessController.doPrivileged((PrivilegedAction<AuthenticationContextConfigurationClient>) AuthenticationContextConfigurationClient::new); AuthenticationContext context = doPrivileged((PrivilegedAction<AuthenticationContext>) () -> { try { URL config = getClass().getResource("wildfly-config-correct-truststore-missing.xml"); return ElytronXmlParser.parseAuthenticationClientConfiguration(config.toURI()).create(); } catch (Throwable t) { throw new InvalidAuthenticationConfigurationException(t); } }); AuthenticationContext contextWithTruststore = doPrivileged((PrivilegedAction<AuthenticationContext>) () -> { try { URL config = getClass().getResource("wildfly-config-correct-truststore.xml"); return ElytronXmlParser.parseAuthenticationClientConfiguration(config.toURI()).create(); } catch (Throwable t) { throw new InvalidAuthenticationConfigurationException(t); } }); SSLContext sslContext = AUTH_CONTEXT_CLIENT.getSSLContext(securedRootUrl.toURI(), contextWithTruststore); context.run(() -> { ResteasyClientBuilder resteasyClientBuilder = (ResteasyClientBuilder) ClientBuilder.newBuilder(); resteasyClientBuilder.sslContext(sslContext).hostnameVerifier((s, sslSession) -> true); ResteasyClient client = resteasyClientBuilder.build(); Response response = client.target(String.valueOf(securedRootUrl)).request().get(); Assert.assertEquals(200, response.getStatus()); }); }