Hi All,
We have a RabbitMQ java client which securely connect to the RabbitMQ server. Currently it seems the hostname verification is not happening in client and in server side. Irrespective of what we put in the CN name of the ceritifcate, we are able to establish a connection.
We need help in enabling hostname verification in java client as well as in RabbitMQ server.
RabbitMQ version : 3.5.2
Erlang : 17.0
Java : Java 7
Client Side :
SSLContext sslContext = SSLContext.getInstance(XFabricConstants.TRANSPORT_LAYER_SECURITY);
sslContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), null);
factory.useSslProtocol(sslContext);
Server Side Settings:
[{rabbit,[{loopback_users, []},{tcp_listeners,[5672]},{ssl_listeners,[5671]},{ssl_options,[{cacertfile,"C:/Users/Administrator/AppData/Roaming/RabbitMQ/Cert/root.pem"},{certfile,"C:/Users/Administrator/AppData/Roaming/RabbitMQ/Cert/cert.pem"},{keyfile,"C:/Users/Administrator/AppData/Roaming/RabbitMQ/Cert/key.pem"},{verify,verify_peer},{fail_if_no_peer_cert,true}]}]}].