Repository navigation
Description
TLS certificates from Gandi need two intermediate certificates for them to actually work, without them, you get an error like this:
v2 ping attempt failed with error: Get https://deployment.rubynerd.net/v2/: x509: certificate signed by unknown authority
from the result of docker login https://deployment.rubynerd.net.
I don't have any experience with TLS in Go, but from my reading last night, it seems that I need to include the intermediate certificates Gandi have supplied me in this array.
I don't imagine I'm the first person to see this, nor will I be the last. The deployment guide states You can buy a certificate for as cheap as 10$ a year. These cheap 10$ certificates almost always depend on some sort of intermediate certificate, so end users following this "highly recommended" solution will find themselves trapped with a 10$ certificate they cannot use.
I consider this a necessary feature to deploy Docker Distribution, and I would like to discuss how this feature should be implemented. If nobody else feels up to the task, I am more than happy to roll up my sleeves and do it myself. However, this is my first time dealing with Go and this codebase, so I want to make sure I'm doing it the right way first.
In terms of proposed solutions, we could take inspiration from nginx, which allows you to concatenate your certificate with its intermediates into one file, which nginx then loads into the SSL context for you. Alternatively, we can specify a path of certificates to load, similarly to how a $PATH variable works in a shell.
I'm eager to hear your thoughts on how this can be resolved - I would like to get this docker registry off the ground as soon as possible as it's blocking other projects!
Activity
taxilian commentedon Jul 9, 2015
Here is how I started my registry instance:
Previous to this I did:
stevvooe commentedon Jul 9, 2015
Here was the first attempt, I believe: #453.
I think we can close this when we have documentation showing how to join intermediate certificates for server cert.
stevvooe commentedon Jul 9, 2015
@taxilian Do you have the command to combine the certs appropriately?
taxilian commentedon Jul 9, 2015
Just updated my comment to have that
taxilian commentedon Jul 9, 2015
The basic syntax for the .crt file should be something like:
Incidentally this is very similar to how nginx expects certificates come
rxbynerd commentedon Jul 9, 2015
Yup, turns out this feature all works as expected with nginx, I must have fudged up a cat command when I was first trying to get this deployed!
To confirm, concatenating the certificates together with a command like
cat server.crt GandiStandardSSLCA2.pem > server.with-intermediate.crtcreates a certificate bundle which can be handled by Go's TLSLoadX509KeyPair, which distribution uses to load certificate files.I'll make a PR for some improved documentation about intermediate certs. Thanks @taxilian!
stevvooe commentedon Jul 9, 2015
@rxbynerd Re-opening until we merge #686.
Include configuration explanation for intermediate TLS certificates
Include configuration explanation for intermediate TLS certificates