Skip to content

Commit 168897c

Browse files
committed
Update to the TLS hostname verification algorithm changes.
1 parent a0b2d1c commit 168897c

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ Future<Void> enableSsl(boolean clientConfigSsl, byte encryptionLevel, MSSQLConne
110110
if (!clientConfigSsl) {
111111
sslOptions.setTrustAll(true);
112112
}
113+
sslOptions.setHostnameVerificationAlgorithm("");
113114

114115
// 2. Create and set up an SSLHelper and SSLHandler
115116
// options.getApplicationLayerProtocols()

vertx-mysql-client/src/main/java/io/vertx/mysqlclient/impl/MySQLConnectionFactory.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ protected Future<Connection> doConnectInternal(MySQLConnectOptions options, Cont
6565
sslOptions = null;
6666
break;
6767
}
68+
if (sslOptions != null && sslOptions.getHostnameVerificationAlgorithm() == null) {
69+
sslOptions.setHostnameVerificationAlgorithm("");
70+
}
6871
int capabilitiesFlag = capabilitiesFlags(options);
6972
if (sslMode == SslMode.PREFERRED) {
7073
return doConnect(options, sslMode, sslOptions, capabilitiesFlag, context).recover(err -> doConnect(options, SslMode.DISABLED, null, capabilitiesFlag, context));

vertx-pg-client/src/main/java/io/vertx/pgclient/impl/PgConnectionFactory.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@
2424
import io.vertx.core.impl.ContextInternal;
2525
import io.vertx.core.impl.VertxInternal;
2626
import io.vertx.core.impl.future.PromiseInternal;
27-
import io.vertx.core.net.ConnectOptions;
28-
import io.vertx.core.net.NetSocket;
29-
import io.vertx.core.net.SocketAddress;
30-
import io.vertx.core.net.TrustOptions;
27+
import io.vertx.core.net.*;
3128
import io.vertx.core.net.impl.NetSocketInternal;
3229
import io.vertx.core.spi.metrics.ClientMetrics;
3330
import io.vertx.core.spi.metrics.VertxMetrics;
@@ -136,7 +133,11 @@ private Future<Connection> doConnect(ConnectOptions connectOptions, ContextInter
136133
// upgrade connection to SSL if needed
137134
connFut = connFut.flatMap(conn -> Future.future(p -> {
138135
PgSocketConnection socket = (PgSocketConnection) conn;
139-
socket.upgradeToSSLConnection(options.getSslOptions(), ar2 -> {
136+
ClientSSLOptions o = options.getSslOptions().copy();
137+
if (o.getHostnameVerificationAlgorithm() == null) {
138+
o.setHostnameVerificationAlgorithm("");
139+
}
140+
socket.upgradeToSSLConnection(o, ar2 -> {
140141
if (ar2.succeeded()) {
141142
p.complete(conn);
142143
} else {

0 commit comments

Comments
 (0)