Skip to content

Commit

Permalink
fix: disable redirect handling in the verifier #952
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronald Holshausen committed Oct 13, 2019
1 parent ab61458 commit d54923d
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -36,20 +36,24 @@ class HttpClientFactory : IHttpClientFactory {
} else if (provider.trustStore != null && provider.trustStorePassword != null) {
createWithTrustStore(provider)
} else {
HttpClients.createDefault()
HttpClients.custom().useSystemProperties().disableRedirectHandling().build()
}
}

private fun createWithTrustStore(provider: IProviderInfo): CloseableHttpClient {
val password = provider.trustStorePassword.orEmpty().toCharArray()
return HttpClients
.custom()
.useSystemProperties()
.disableRedirectHandling()
.setSslcontext(SSLContextBuilder().loadTrustMaterial(provider.trustStore, password).build())
.build()
}

private fun createInsecure(): CloseableHttpClient {
val b = HttpClientBuilder.create()
.useSystemProperties()
.disableRedirectHandling()

// setup a Trust Strategy that allows all certificates.
//
Expand Down

0 comments on commit d54923d

Please sign in to comment.