-
Notifications
You must be signed in to change notification settings - Fork 24
rocks-strata doesn't seem to work with TLS/SSL Mongo #14
Comments
Yeah, you're right @classam . We never implemented ssl support. This is where we connect to mongo: https://github.com/facebookgo/rocks-strata/blob/master/strata/mongo/lreplica/replica.go#L36. Looks like the mongo driver supports connection over ssl (https://github.com/go-mgo/mgo/issues/84#issuecomment-89156585), so it shouldn't be hard to implement if you have some time on your hand :) |
Hi @igorcanadi, I've attempted adding SSL support by modifying the
Unfortunately, it still did not work, returning Here is my fork of rocks-strata, with my attempt: derfshaya/rocks-strata Thank you very much, in advance! |
I'm afraid that I'm not familiar with mongo's go driver. :( Would it make sense to post this question to https://github.com/go-mgo/mgo/issues? |
It would indeed make sense. Thank you for your kind help in redirection! On Sat, 30 Jul 2016 1:08 am Igor Canadi [email protected] wrote:
|
My experience with the mgo driver is that it hides a lot of simple errors (bad authentication, for instance) behind the very vague message 'no reachable servers', so it's a good idea to check all basic assumptions you're making (address, port, authentication, etc). My hunch is that this is due to your TLS config. Most TLS libs are defensive about certificate chain and hostname verification. Unless you've generated a trusted certificate that matches your DB host name, it's likely to fail. You can check this quickly by initializing the tls config with InsecureSkipVerify = true. So:
More info here: https://golang.org/pkg/crypto/tls/#Config I think it may be more appropriate here to create an alternative to localSessionGetter that allows you to supply more information, such as hostname and optional certificate chain. |
And a year or more later, on this lands of issues... |
My mongo server is configured using a LetsEncrypt SSL cert.
When I run the sample
Rocks-strata tries to connect to the local mongo instance without ssl, and fails to connect.
The text was updated successfully, but these errors were encountered: