diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java index 4fec5da78..d48252174 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java @@ -171,6 +171,9 @@ private static MessageDigest newMD5() { /** S3 Bucket Domain. */ private final String domain; + /** S3 Protocol, "https" or "http"; defaults to "http". */ + private final String protocol; + /** S3 Region. */ private final String region; @@ -183,6 +186,7 @@ interface Keys { String CRYPTO_ALG = "crypto.algorithm"; //$NON-NLS-1$ String CRYPTO_VER = "crypto.version"; //$NON-NLS-1$ String ACL = "acl"; //$NON-NLS-1$ + String PROTOCOL = "protocol"; //$NON-NLS-1$ String DOMAIN = "domain"; //$NON-NLS-1$ String REGION = "region"; //$NON-NLS-1$ String HTTP_RETRY = "httpclient.retry-max"; //$NON-NLS-1$ @@ -246,6 +250,8 @@ public AmazonS3(final Properties props) { awsApiSignatureVersion)); } + protocol = props.getProperty(Keys.PROTOCOL, "http"); //$NON-NLS-1$ + domain = props.getProperty(Keys.DOMAIN, "s3.amazonaws.com"); //$NON-NLS-1$ publicKey = props.getProperty(Keys.ACCESS_KEY); @@ -590,7 +596,8 @@ HttpURLConnection open(final String method, final String bucket, final String key, final Map args) throws IOException { final StringBuilder urlstr = new StringBuilder(); - urlstr.append("http://"); //$NON-NLS-1$ + urlstr.append(protocol); //$NON-NLS-1$ + urlstr.append("://"); //$NON-NLS-1$ urlstr.append(bucket); urlstr.append('.'); urlstr.append(domain);