-
Notifications
You must be signed in to change notification settings - Fork 40
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
TLS support #20
Comments
Hi there. I have pushed a WIP branch that implements TLS support. To use that you need to create a String pathToCerts = "...";
SecurityContext ctx = new SecurityContext()
..useCertificateChain(path + "client_certificate.pem")
..usePrivateKey(path + "client_key.pem")
..setClientAuthorities(path+"ca_certificate.pem");
ConnectionSettings settings = new ConnectionSettings(tlsContext: ctx);
Client client = new Client(settings: settings); However, I haven't been able to get it to work with self-signed certificates (even though I explicitly provide the CA pem file to the context) without providing an accept-all callback (onBadCertificate) to Once I figure out a way to make this work properly I will open a PR. |
Using your example and the branch you linked, I got the following scenarios working:
What is interesting, however, is the fact that I succeeded with a certificate that was signed by my self-signed certificate, but not the self-signed cert itself. The code I used to set up the String basePath = "/path/to/my/certs";
SecurityContext ctx = SecurityContext.defaultContext
// Client cert and private key
..useCertificateChain("${basePath}/test-client.crt")
..usePrivateKey("${basePath}/test-client.key"); Why exactly the self-signed certificate itself didn't work, is a mystery to me. For completeness, here was my setup:
|
On further inspection, the inability to connect with a self-signed certificate seems to be a problem with either RabbitMQ or my configuration of RabbitMQ. I turned the
Success
Success
Failed (rabbit says 'bad certificate', openssl exits with status code 1) |
Any chance this will be merged into a release soon? I'm running rabbit MQ with fail_if_no_peer_cert=false |
Is there any plans of adding TLS support?
If so, is there a timeline?
The text was updated successfully, but these errors were encountered: