-
Notifications
You must be signed in to change notification settings - Fork 532
RUBY-1774 use add_file instead of adding a Certificate object #1319
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
Conversation
Thank you for the PR. We do have a tool that generates the certificates, but I'm thinking to leave the existing single-cert bundle in place and add another bundle for testing a cert chain. Can you generate those and put them in Also would you mind adding a note to the tutorial stating that |
sounds good 👍 |
@p-mongo I created the new certificates for the new tests, but I may need some context regarding the automated tests. My idea is to create a new I'm trying to find where the main mongod + TLS process is configured, but can't find it in the .travisci.yml. I only found this https://github.com/mongodb/mongo-ruby-driver/blob/master/.travis.yml#L15, but it doesn't enable TLS. Do you use some infrastructure not defined in this repo? |
Are you able to run (and pass) the test you are writing when launching the server following instructions in https://github.com/mongodb/mongo-ruby-driver/tree/master/spec#tls-without-verification, using your generated certificates ? TLS is tested in Evergreen and it is configured via mongo-orchestration. I think ultimately I will need to either generate the intermediate cert using existing CA in the test suite or rebuild all certificates from the same CA, but we also have some more work to do related to the TLS tests performing certificate verification. |
I added a single test to demonstrate that my change works. The commands I used to validate it locally are:
I added a single test as a PoC. Without knowing how the infrastructure side will look like, it's difficult to come up with relevant tests. I'm not sure how to proceed here. I'm happy to help on whatever you need from me 👍 |
Thank you, I will get back to you regarding the tests. Are you able to make the documentation changes mentioned? I am also curious whether the certificates can be given in any order (i.e. ca first or intermediate first). |
I just tested running the tests with the ca-chain being: Also, I was checking the documentation in
It looks like this is a bug fix instead of a new feature. I can rephrase the documentation, but I think it's well explained already. |
Thank you for the patch. As I mentioned in the comment on the ticket (https://jira.mongodb.org/browse/RUBY-1774?focusedCommentId=2268947&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-2268947), this PR is superseded by #1367 for certificate chain support and #1368 for multiple CA certificate support. |
Summary
Use the
add_file
method in order to parse all the certificates in the file, not only the first one.This is needed if the CA cert file contains an intermediate CA and a root CA
Notes
I want to add tests but I would like to know if you have a specific way to generate the certificates in https://github.com/mongodb/mongo-ruby-driver/tree/master/spec/support/certificates
If not, I can do it myself and add them to this PR.
TODO: