mirror of https://github.com/apache/jclouds.git
auto-redirection to SSL addresses doesn't work, using jclouds redirection
git-svn-id: http://jclouds.googlecode.com/svn/trunk@1469 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
parent
7b1f565308
commit
27f360e88e
|
@ -88,7 +88,10 @@ public class JavaUrlHttpFutureCommandClient extends BaseHttpFutureCommandClient<
|
||||||
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
||||||
connection.setDoOutput(true);
|
connection.setDoOutput(true);
|
||||||
connection.setAllowUserInteraction(false);
|
connection.setAllowUserInteraction(false);
|
||||||
connection.setInstanceFollowRedirects(true);
|
// 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>
|
||||||
|
connection.setInstanceFollowRedirects(false);
|
||||||
connection.setRequestMethod(request.getMethod().toString());
|
connection.setRequestMethod(request.getMethod().toString());
|
||||||
for (String header : request.getHeaders().keySet()) {
|
for (String header : request.getHeaders().keySet()) {
|
||||||
for (String value : request.getHeaders().get(header))
|
for (String value : request.getHeaders().get(header))
|
||||||
|
@ -126,7 +129,7 @@ public class JavaUrlHttpFutureCommandClient extends BaseHttpFutureCommandClient<
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void cleanup(HttpURLConnection connection) {
|
protected void cleanup(HttpURLConnection connection) {
|
||||||
if (connection.getContentLength() == 0)
|
if (connection != null && connection.getContentLength() == 0)
|
||||||
connection.disconnect();
|
connection.disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue