mongodb icon indicating copy to clipboard operation
mongodb copied to clipboard

ssl connect: TLS connection is closed on Mongo Atlas

Open zeroshree opened this issue 8 years ago • 4 comments

Hi I am using this driver with elixir 1.6.x and OTP 19 and it is working fine. (With all TLS 1.0,1.1,1.2)

Whenever I am using with elixir 1.7.x and OTP 21 I am getting following error.

[error] Mongo.Protocol (#PID<0.1791.0>) failed to connect: ** (Mongo.Error) ssl connect: TLS connection is closed - :closed

Mongo Atlas DB Cluster(4.0.2), I am using seeds.

Please have a look into this.

zeroshree avatar Sep 21 '18 11:09 zeroshree

I believe there were some changes to the ssl module cipher list in OTP 21. I will look a little deeper into it and get back to this.

ankhers avatar Sep 21 '18 12:09 ankhers

I am also facing the same issue :(

yatender-oktalk avatar Sep 27 '18 10:09 yatender-oktalk

I faced the same problem and solved it thanks to an advise from the Elixir Forum. To sum up the cipher used by MongoDB Atlas is disabled by default in the OTP 21 so you need to specify it manually in your mongoDB connection options. You must have this in your MongoDB options : ssl: true, ssl_opts: [ ciphers: ['AES256-GCM-SHA384'], versions: [:"tlsv1.2"] ] Note that the option uses simple quotes and it does not work with double quotes !

Original post here : https://elixirforum.com/t/mongodb-and-ssl-ciphers-failed-to-connect/16928

norman-forti avatar Oct 01 '18 07:10 norman-forti

Thanks a lot @norman-forti. it has been fixed now.

zeroshree avatar Oct 01 '18 08:10 zeroshree