globalsign / mgo

The MongoDB driver for Go
Other
1.97k stars 230 forks source link

doc: Added code snippet for dialing via SSL. #139

Closed ReeseWang closed 6 years ago

ReeseWang commented 6 years ago

Sorry for my incompetence, but I spent hours debugging "no reachable servers" error only to find that I should have connected via SSL but no one told me. So I decided to add something to the doc.

domodwyer commented 6 years ago

Hi @ReeseWang

Thanks for the PR - I'll add a commit with your code as an example as I think it's covered by tests that way.

Dom

tbruyelle commented 6 years ago

IMO mgo should handle the ssl=<true|false> query param and setup the DialServer accordingly.

What do you think ?

domodwyer commented 6 years ago

Hi @tbruyelle

No objection to having ssl dial string support! Always happy to receive a PR :)

Dom

tbruyelle commented 6 years ago

Thx @domodwyer I've just submitted a PR