Skip to content

Commit f8c8189

Browse files
committed
Use localhost for hostname verification test
localhost is now part of the SAN of the generated server certificate, so the hostname verification succeeds. References #394 (cherry picked from commit f73b80a) Conflicts: src/test/java/com/rabbitmq/client/test/ssl/HostnameVerification.java
1 parent 4277aee commit f8c8189

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/test/java/com/rabbitmq/client/test/ssl/HostnameVerification.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import com.rabbitmq.client.ConnectionFactory;
2222
import com.rabbitmq.client.ConnectionPostProcessors;
2323
import com.rabbitmq.client.test.TestUtils;
24-
import com.rabbitmq.tools.Host;
2524
import org.apache.http.conn.ssl.DefaultHostnameVerifier;
2625
import org.bouncycastle.est.jcajce.JsseDefaultHostnameAuthorizer;
2726
import org.bouncycastle.est.jcajce.JsseHostnameAuthorizer;
@@ -197,8 +196,8 @@ public void hostnameVerificationSucceeds() throws Exception {
197196
new AddressResolver() {
198197

199198
@Override
200-
public List<Address> getAddresses() throws IOException {
201-
return singletonList(new Address(Host.systemHostname(), ConnectionFactory.DEFAULT_AMQP_OVER_SSL_PORT));
199+
public List<Address> getAddresses() {
200+
return singletonList(new Address("localhost", ConnectionFactory.DEFAULT_AMQP_OVER_SSL_PORT));
202201
}
203202
});
204203
assertTrue(conn.isOpen());

0 commit comments

Comments
 (0)