Skip to content

Commit 6eb350e

Browse files
authored
Update to use JDK's deafult trust CA store for cert validations (#48046)
1 parent 175c7e2 commit 6eb350e

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

sdk/openai/azure-ai-openai-realtime/src/main/java/com/azure/ai/openai/realtime/implementation/websocket/WebSocketSessionNettyImpl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import io.netty.handler.codec.http.websocketx.extensions.compression.WebSocketClientCompressionHandler;
3131
import io.netty.handler.ssl.SslContext;
3232
import io.netty.handler.ssl.SslContextBuilder;
33-
import io.netty.handler.ssl.util.InsecureTrustManagerFactory;
3433
import io.netty.handler.timeout.IdleStateHandler;
3534

3635
import javax.net.ssl.SSLException;
@@ -127,7 +126,7 @@ void connect() throws URISyntaxException, SSLException, InterruptedException, Ex
127126
final boolean ssl = "wss".equalsIgnoreCase(scheme);
128127
final SslContext sslCtx;
129128
if (ssl) {
130-
sslCtx = SslContextBuilder.forClient().trustManager(InsecureTrustManagerFactory.INSTANCE).build();
129+
sslCtx = SslContextBuilder.forClient().endpointIdentificationAlgorithm("HTTPS").build();
131130
} else {
132131
sslCtx = null;
133132
}

sdk/webpubsub/azure-messaging-webpubsub-client/src/main/java/com/azure/messaging/webpubsub/client/implementation/websocket/WebSocketSessionNettyImpl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import io.netty.handler.codec.http.websocketx.extensions.compression.WebSocketClientCompressionHandler;
3030
import io.netty.handler.ssl.SslContext;
3131
import io.netty.handler.ssl.SslContextBuilder;
32-
import io.netty.handler.ssl.util.InsecureTrustManagerFactory;
3332

3433
import javax.net.ssl.SSLException;
3534
import java.net.URI;
@@ -119,7 +118,7 @@ void connect() throws URISyntaxException, SSLException, InterruptedException, Ex
119118
final boolean ssl = "wss".equalsIgnoreCase(scheme);
120119
final SslContext sslCtx;
121120
if (ssl) {
122-
sslCtx = SslContextBuilder.forClient().trustManager(InsecureTrustManagerFactory.INSTANCE).build();
121+
sslCtx = SslContextBuilder.forClient().endpointIdentificationAlgorithm("HTTPS").build();
123122
} else {
124123
sslCtx = null;
125124
}

0 commit comments

Comments
 (0)