Skip to content

Commit f75cada

Browse files
committed
Update to use the new trust all config mechanism
1 parent 5ab12ad commit f75cada

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

vertx-mssql-client/src/main/java/io/vertx/mssqlclient/impl/MSSQLSocketConnection.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@
2121
import io.vertx.core.impl.future.PromiseInternal;
2222
import io.vertx.core.net.ClientSSLOptions;
2323
import io.vertx.core.net.HostAndPort;
24-
import io.vertx.core.net.impl.NetSocketInternal;
25-
import io.vertx.core.net.impl.SSLHelper;
26-
import io.vertx.core.net.impl.SslChannelProvider;
27-
import io.vertx.core.net.impl.SslHandshakeCompletionHandler;
24+
import io.vertx.core.net.impl.*;
2825
import io.vertx.core.spi.metrics.ClientMetrics;
2926
import io.vertx.mssqlclient.MSSQLConnectOptions;
3027
import io.vertx.mssqlclient.MSSQLInfo;
@@ -108,15 +105,15 @@ Future<Void> enableSsl(boolean clientConfigSsl, byte encryptionLevel, MSSQLConne
108105

109106
// Do not perform hostname validation if the client did not require encryption
110107
if (!clientConfigSsl) {
111-
sslOptions.setTrustAll(true);
108+
sslOptions.setTrustOptions(TrustAllOptions.INSTANCE);
112109
}
113110
sslOptions.setHostnameVerificationAlgorithm("");
114111

115112
// 2. Create and set up an SSLHelper and SSLHandler
116113
// options.getApplicationLayerProtocols()
117114
Future<SslChannelProvider> f = sslHelper.resolveSslChannelProvider(sslOptions, "", false, null, null, context);
118115
return f.compose(provider -> {
119-
SslHandler sslHandler = provider.createClientSslHandler(socket.remoteAddress(), null, sslOptions.isUseAlpn(), sslOptions.isTrustAll(), sslOptions.getSslHandshakeTimeout(), sslOptions.getSslHandshakeTimeoutUnit());
116+
SslHandler sslHandler = provider.createClientSslHandler(socket.remoteAddress(), null, sslOptions.isUseAlpn(), sslOptions.getSslHandshakeTimeout(), sslOptions.getSslHandshakeTimeoutUnit());
120117

121118
// 3. TdsSslHandshakeCodec manages SSL payload encapsulated in TDS packets
122119
TdsSslHandshakeCodec tdsSslHandshakeCodec = new TdsSslHandshakeCodec();

0 commit comments

Comments
 (0)