I'm trying to use aio-pika to establish a secured connection to rabbitmq, while disabling certificate verification.
According to the documentation you can pass both ssl
boolean flag, and ssl_options
dictionary.
I tried passing both, specifying ssl_option with no certificate, but it still fails.
connection = await connect_robust(
host=self.host,
virtualhost=self.rmq_vhost,
port=int(self.rmq_port),
login=self.rmq_user,
ssl=True,
ssl_options=None, # also tried dict(cert_reqs=ssl.CERT_NONE),
password=self.rmq_pass,
loop=main_loop)
The received error is:
[Errno 1] [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for '10.0.0.1'. (_ssl.c:1122)
https://aio-pika.readthedocs.io/en/latest/apidoc.html?highlight=ssl#aio_pika.connect_robust
I do not want to (and cannot) change the server configuration. Would like to do it on the client side. I'm able to disable it and connect fine with programs written in other languages (typescript, .Net).