Skip to content

Commit b47a3c6

Browse files
committed
Disable hostname verification in trust-everything TLS configuration
By using Netty SslContextBuilder.endpointIdentificationAlgorithm(null). References #709
1 parent 13445d1 commit b47a3c6

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
/** Classes for AMQP 1.0 support. */
1+
/** Classes for AMQP 1.0 message format support. */
22
package com.rabbitmq.stream.amqp;

src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,7 @@ class StreamEnvironment implements Environment {
129129
try {
130130
SslContext sslContext =
131131
tlsConfiguration.sslContext() == null
132-
? SslContextBuilder.forClient()
133-
.endpointIdentificationAlgorithm(
134-
tlsConfiguration.hostnameVerificationEnabled() ? "HTTPS" : null)
135-
.build()
132+
? SslContextBuilder.forClient().build()
136133
: tlsConfiguration.sslContext();
137134

138135
clientParametersPrototype.sslContext(sslContext);

src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ public TlsConfiguration trustEverything() {
402402
this.sslContext(
403403
SslContextBuilder.forClient()
404404
.trustManager(Utils.TRUST_EVERYTHING_TRUST_MANAGER)
405-
.endpointIdentificationAlgorithm("NONE")
405+
.endpointIdentificationAlgorithm(null)
406406
.build());
407407
} catch (SSLException e) {
408408
throw new StreamException("Error while creating Netty SSL context", e);

0 commit comments

Comments
 (0)