-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Can't connect with Mongodb 3.0, 3.2 with ssl #1996
Comments
@reinaldomendes |
@vishalnayak none of options on vault write --help is useful in this case. With this certs I can connect on mongodb and on vault server, but if we use ssl to write config on mongodb secret backend It's doesn't works. |
@reinaldomendes It looks like Vault parses the URL provided to handle the The only way to make this work is to provide cert options on the URL and having Vault populate the If anyone wants to tackle this, we would be happy to review a PR. |
How about just adding more parameters to the database/config endpoint similar to the Cassandra plugin rather than customize the URI parsing? Adding sslPEMKey and sslCA should cover it. That would be similar to the MongoDB parameters. Or follow the Cassandra approach with pem_json/pem_bundle. For my use case the pem_json would be most useful as I am getting the certificates from Vault. I can implement that if there is interest. |
This is a bit old but with Vault 0.8.3 and Mongo 3.4.7 we get the same error trying to write a mongo config when passing the ssl parameter "?ssl=true"
It looks like Vault had implemented a work-around for the driver to parse the url for those parameters here https://github.com/hashicorp/vault/blob/master/plugins/database/mongodb/connection_producer.go#L141 but I'm not sure it's actually working. Are there any known fixes at this time? |
A simple way to check whether that code is being hit would be to change the ssl parameter to something like |
@jefferai I did test that out and it was parsing the parameter correctly. Ex:
I did manage to figure out our issue though. We are using Vault as the CA for our Mongo certs, among others, so I had figured it would recognize the cert being presented, but I ended up having to import Vault's CA cert into the OS ca-certs (Ubuntu being /usr/local/share/ca-certificates/) and then restart Vault. Once Vault was back up everything worked as expected. This is an easy change for me, but I initially thought Vault would be able to compare the cert against its own CA first. The irony there is I had planned on importing the CA's from Vault as a default across the board but decided against it (until now). For those interested, this was the error that Vault was presenting in the Mongo log which made me realize we had to import the CA:
Everything is working as expected. |
Any updates on this? I'm trying to configure
This is because my Mongo replica set configuration requires SSL connection. If I change this config to allow non-ssl connections, it works just fine. |
Hi,
I'm trying this tutorial but I have some problem with ssl.
https://www.vaultproject.io/docs/secrets/mongodb/index.html
When I execute the command bellow I have this error occours.
If I disable ssl it works.
I'm already configured the ca.pem key and certs for mongo.
I can connect in mongo with ruby and by terminal.
In ruby I can connect with:
So I think that I need to inform client and CA certs for vault write command, but I don't found a way to do that.
On the container of MongoDb I have those logs when I connect with error occours.
The text was updated successfully, but these errors were encountered: