> 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()) {
not sure we need to guard this.. we probably can configure this globally, as
there's no request-scoped difference here. If the request isn't ssl, this
config simply wouldn't be used. less if statements is better.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/617/files#r20973472