I'm trying to setup a development environment where TLS is enabled for RabbitMQ. So here is what I did:
tls-gen
script to generate certificates with basic profile.ca-certificate.pem
, server-certificate.pem
, and server-key.pem
.sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain testca/ca_certificate.pem
to add the CA certificate to the trusted rootsclient_certificate.pem
, and client-key.pem
into a tls.Config
amqp.DialTLS()
.I got the following error message:
err: x509: certificate signed by unknown authority
which is unexpected. In step 4 above, if I add the ca-certificate.pem
into the root CAs of the tls.Config
, it works fine. So I'm suspecting that the addition of the root ca macOS is not right.
Can somebody review the above and point out my mistake?