> OkHttpClient client = new OkHttpClient();
> - URL url = request.getEndpoint().toURL();
> - client.setProxy(proxyForURI.apply(request.getEndpoint()));
> - if (url.getProtocol().equalsIgnoreCase("https")) {
> + client.setConnectTimeout(utils.getConnectionTimeout(),
> TimeUnit.MILLISECONDS);
> + client.setReadTimeout(utils.getSocketOpenTimeout(),
> TimeUnit.MILLISECONDS);
> + // do not follow redirects since https redirects don't work properly
> + // ex. Caused by: java.io.IOException: HTTPS hostname wrong: should be
> + // <adriancole.s3int0.s3-external-3.amazonaws.com>
> + client.setFollowRedirects(false);
> + client.setProxy(proxyForURI.apply(request.uri()));
> +
> + if (request.isHttps()) {
> if (utils.relaxHostname()) {
> client.setHostnameVerifier(verifier);
> }
> if (sslContextSupplier != null) {
TODO: allow users to configure ConnectionSpec, and get out of this mess!
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/617/files#r20973368