Skip to content

Commit 3958d9b

Browse files
committed
Address feedback
1 parent b2e988f commit 3958d9b

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

services/s3/src/main/java/software/amazon/awssdk/services/s3/internal/crt/S3NativeClientConfiguration.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,14 @@ public S3NativeClientConfiguration(Builder builder) {
7676
TlsContextOptions.createDefaultClient()
7777
.withCipherPreference(TlsCipherPreference.TLS_CIPHER_SYSTEM_DEFAULT);
7878

79-
if (builder.httpConfiguration != null
80-
&& Boolean.TRUE.equals(builder.httpConfiguration.trustAllCertificatesEnabled())) {
81-
log.warn(() -> "SSL Certificate verification is disabled. "
82-
+ "This is not a safe setting and should only be used for testing.");
83-
clientTlsContextOptions.withVerifyPeer(!builder.httpConfiguration.trustAllCertificatesEnabled());
79+
if (builder.httpConfiguration != null &&
80+
builder.httpConfiguration.trustAllCertificatesEnabled() != null) {
81+
Boolean trustAllCertificatesEnabled = builder.httpConfiguration.trustAllCertificatesEnabled();
82+
if (Boolean.TRUE.equals(trustAllCertificatesEnabled)) {
83+
log.warn(() -> "SSL Certificate verification is disabled. "
84+
+ "This is not a safe setting and should only be used for testing.");
85+
}
86+
clientTlsContextOptions.withVerifyPeer(!trustAllCertificatesEnabled);
8487
}
8588
this.tlsContext = new TlsContext(clientTlsContextOptions);
8689
this.credentialProviderAdapter = new CrtCredentialsProviderAdapter(

0 commit comments

Comments
 (0)