Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMQP_STATUS_SSL_PEER_VERIFY_FAILED with Letsencrypt certificate #648

Closed
tschoonj opened this issue Feb 12, 2021 · 1 comment · Fixed by #790
Closed

AMQP_STATUS_SSL_PEER_VERIFY_FAILED with Letsencrypt certificate #648

tschoonj opened this issue Feb 12, 2021 · 1 comment · Fixed by #790

Comments

@tschoonj
Copy link

Hi,

I am trying to connect to my rabbitmq server which has SSL enabled using Letsencrypt generated certificates, which are currently valid.

I can use the rabbitmq server with pika over SSL without any additional configuration.

However with rabbitmq-c, on the same machine, I run into AMQP_STATUS_SSL_PEER_VERIFY_FAILED. Any thoughts on why this is? The root and intermediate certificates are all present and in the openssl search path.

@tschoonj
Copy link
Author

I can make the problem go away by forcing openssl to load the default certificates:

diff --git a/librabbitmq/amqp_openssl.c b/librabbitmq/amqp_openssl.c
index 0a37fe0..9086c9f 100644
--- a/librabbitmq/amqp_openssl.c
+++ b/librabbitmq/amqp_openssl.c
@@ -365,6 +365,8 @@ amqp_socket_t *amqp_ssl_socket_new(amqp_connection_state_t state) {
    * logic not behave as expected, so turn this back off */
   SSL_CTX_clear_mode(self->ctx, SSL_MODE_AUTO_RETRY);
 
+  SSL_CTX_set_default_verify_paths(self->ctx);
+
   amqp_set_socket(state, (amqp_socket_t *)self);
 
   return (amqp_socket_t *)self;

@alanxz Would you accept a PR that introduces this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment