From 2b29bcd588f4c58b6c65f011580a06485a816f2b Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Thu, 12 Mar 2015 17:37:25 -0700 Subject: [PATCH] Disable AWS SDK SSL verification --- src/test/java/org/gaul/s3proxy/S3AwsSdkTest.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/test/java/org/gaul/s3proxy/S3AwsSdkTest.java b/src/test/java/org/gaul/s3proxy/S3AwsSdkTest.java index 4f4f792..715f4b8 100644 --- a/src/test/java/org/gaul/s3proxy/S3AwsSdkTest.java +++ b/src/test/java/org/gaul/s3proxy/S3AwsSdkTest.java @@ -21,6 +21,7 @@ import java.net.URI; import java.util.Properties; import java.util.Random; +import com.amazonaws.SDKGlobalConfiguration; import com.amazonaws.auth.BasicAWSCredentials; import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.AmazonS3Client; @@ -43,6 +44,12 @@ import org.junit.Test; import org.junit.rules.ExpectedException; public final class S3AwsSdkTest { + static { + System.setProperty( + SDKGlobalConfiguration.DISABLE_CERT_CHECKING_SYSTEM_PROPERTY, + "true"); + } + @Rule public ExpectedException thrown = ExpectedException.none(); @@ -75,10 +82,8 @@ public final class S3AwsSdkTest { S3ProxyConstants.PROPERTY_IDENTITY); s3Credential = s3ProxyProperties.getProperty( S3ProxyConstants.PROPERTY_CREDENTIAL); - // The AWS client fails if certificate verification fails s3Endpoint = new URI(s3ProxyProperties.getProperty( - S3ProxyConstants.PROPERTY_ENDPOINT).replaceAll( - "https", "http")); + S3ProxyConstants.PROPERTY_ENDPOINT)); String keyStorePath = s3ProxyProperties.getProperty( S3ProxyConstants.PROPERTY_KEYSTORE_PATH); String keyStorePassword = s3ProxyProperties.getProperty(