Skip to content

TLS CA Certs - #453

Closed
sthulb wants to merge 1 commit into
distribution:masterfrom
sthulb:ca-certs
Closed

sthulb wants to merge 1 commit into
distribution:masterfrom
sthulb:ca-certs

Conversation

@sthulb

@sthulb sthulb commented Apr 28, 2015

Copy link
Copy Markdown

I've added the ability to present the CA cert with the server certificates, this allow for greater trust between the server and client.

@stevvooe

Copy link
Copy Markdown
Collaborator

@sthulb How is this different from the existing functionality? Could you make sure to modify the documentation accordingly?

@sthulb

sthulb commented Apr 28, 2015

Copy link
Copy Markdown
Author

@stevvooe this would be like SSLCertificateChainFile in Apache.

@stevvooe

Copy link
Copy Markdown
Collaborator

@sthulb How is that different from the existing functionality in the registry? How is it different from ClientCAs and Certificates?

@sthulb

sthulb commented Apr 28, 2015

Copy link
Copy Markdown
Author

@stevvooe the new code creates a pool for pool.RootCAs

@stevvooe

Copy link
Copy Markdown
Collaborator

@sthulb According to http://golang.org/pkg/crypto/tls/#Config, this removes the need for a client to provide the entire certificate chain. The configuration value should match the name RootCAs and the description of what it does should be added to docs/configuration.md.

@sthulb

sthulb commented Apr 28, 2015

Copy link
Copy Markdown
Author

Yep. It allows the server to verify the server's cert for the client. I'll add the extra docs.

Comment thread configuration/configuration_test.go Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clear, this should be called RootCAs to match up with the crypto/tls config.

@sthulb

sthulb commented Apr 29, 2015

Copy link
Copy Markdown
Author

@stevvooe updated.

Comment thread configuration/configuration.go Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow Go's documentation guidelines. This should start with "RootCAs".

@sthulb

sthulb commented May 1, 2015

Copy link
Copy Markdown
Author

@stevvooe Fixed both points, thanks

Comment thread docs/configuration.md Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"An array of paths to root CA files in x509 format used to verify client certificates."

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change has nothing to do with client certs. It's to prove validation of the serverside certs

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. So, could you clarify it? Please see Go's documentation for clarification:

// RootCAs defines the set of root certificate authorities
// that clients use when verifying server certificates.
// If RootCAs is nil, TLS uses the host's root CA set.

If the documentation is not clear, the feature will not be added.

Signed-off-by: Simon Thulbourn <[email protected]>
@stevvooe

Copy link
Copy Markdown
Collaborator

@sthulb Could you please rebase this? I'd like to merge it for 2.1.

cc @diogomonica @NathanMcCauley PTAL

Comment thread cmd/registry/main.go

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you give me an usecase where we would use a different reader other than ioutil.ReadFile?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this purely for testability?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, appears so.

@diogomonica

Copy link
Copy Markdown
Contributor

I don't get why this functionality is needed.

@sthulb even SSLCertificateChainFile is being deprecated in liu of adding the chain to SSLCertificateFile: http://www.bensprotips.com/2014/04/apache-sslcertificatechainfile-directive-deprecated-sslcertificatefile/

If we need to serve intermediates we should be hosting them in the same convention that web servers follow (host the chain in one file).

What am I missing?

@sthulb

sthulb commented May 26, 2015

Copy link
Copy Markdown
Author

@diogomonica @stevvooe Hi, sorry for the delay... This PR was to just allow users to present their CA cert with the server certificate for extra validation. It also gives the user the ability to trust more than just their registry, but their entire CA chain.

Whilst this is similar to SSLCertficateChainFile, that's due to Go only supporting that as an option. We could artificially limit it to a cert in a file.

@diogomonica

Copy link
Copy Markdown
Contributor

@sthulb sorry, still not getting the use-case. Can you make it a bit more explicit?

Allow users to present their CA cert with the server certificate for extra validation

What are "users" in this sentence. Does this mean: including the whole CA chain in the certificate served to the clients connecting to the registry? And if so, can't we just include the whole chain in the server.pem?

It also gives the user the ability to trust more than just their registry, but their entire CA chain.

How does the server configuration change in regards to this. This is a matter of the clients trusting a CA instead of the server certificate directly, no?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants