Certificate Verification
Hi Guys,
Apologies if I'm jumping ahead, but I've noticed that commit 101bd654711d1904597a9933e61d2d935133b384 now adds SSL verification.
This appears to stop usage not only when using self signed certificates, but also when using certificates that require a CA Certificate to be attached (eg: GoDaddy certificates - at least from my linux box).
Is there a way to make the cli to read the root chain being provided as part of the certificate?
If using self-signed certificates (which most people are in dev), this will completely prevent usage. Are there plans to have a flag to disable verification so it can be used with self-signed certs?
Looks like there is a function SetTrustedCerts in gatway.go. Is there a way to import the cert into gateway.trustedCerts based on a command line arg?
True, there is some vestigial code in gateway.go that would allow for setting a trusted cert. That is mostly present to make our tests easier, although it certainly would be helpful if we wanted to allow users to add a trusted cert through the cf cli. However, we never prioritized any stories because we did not hear any feedback from users requesting that. It sounds like you're asking for it now, which is pretty cool.
My understanding is that the stdlib in Go will defer to the system keychain. If you can get the OS X keychain to add it, you should be good to go. I've followed these steps before with some luck. The step I usually forget is setting the trust settings to "always trust".
Adding the certificate to the keychain as "Always trusted" didn't seem to work when I tried a while back. It worked in Chrome (no longer get cert warning), but didn't on the cf cli.
Thanks for the info @wdneto -- I've added a chore for ourselves to investigate how to make this work on OS X.
Hello @tjarratt, I feel stupid now ... I restarted the whole setup with new certificate and it worked this time. It worked even with the User keychain. (I didn't have to import the certificate into the System keychain). I must have been working with a bad certificate.
@softwarepsychology don't feel stupid! Software is finicky and prone to failure. I'm just happy that you resolved your problem and that everything works. In my opinion, it's literally a miracle whenever any software works at all.
Something good has come of this conversation actually, you helped remind us that we need to understand how to permanently accept self-signed certificates for Windows and OS X. At some point in the future, I'm sure another user will come along and ask how to do it. It would be very nice if we could tell them how.
I am glad it was of some use :) ... Just to review, I did the following:
- created a public/private key pair using OpenSSL
- Updated the key pair in the haproxy ssl_pem setting in cf-manifest.yml bosh deployment file and deployed using bosh.
- Imported the public key into the User keychain of OSX.
Thanks for all your help!