play 2.3 and ssl option for reactive mongo

42 views
Skip to first unread message

zafar.k...@huffingtonpost.com

unread,
Jan 10, 2017, 12:31:26 PM1/10/17
to ReactiveMongo - http://reactivemongo.org
Hi there,

Hope this is the right forum to ask.
I want to make a shortcut by asking:
I need to connect to SSL-ed mongo

Using Play-ReactiveMongo for play 2.3 and passing connection parameters via URI (as I don't have it as an option for this version)

lazy val driver = new MongoDriver(Akka.system(app))
val uri = "mongodb://localhost:27017/?authMode=scram-sha1&ssl=true"

import scala.concurrent.duration._

val parsed =Await.result(Future.fromTry(MongoConnection.parseURI(uri)), 2 seconds)
lazy val connection: MongoConnection = driver.connection(parsed)
lazy val db = DB(dbName, connection)


When it tries to connect, server says:
[conn52] AssertionException handling request, closing client connection: 17189 The server is configured to only allow SSL connections

because server is configured to allow SSL only, which is expected and it means that the URI param doe not work.

So the question I have, did anybody run play 2.3 plug-in with SSL, if so, please share some insights.

Thank you in advance

-
Zafar



zafar.k...@huffingtonpost.com

unread,
Jan 10, 2017, 1:13:31 PM1/10/17
to ReactiveMongo - http://reactivemongo.org
Forgot to mentioned the dependency:
"org.reactivemongo" %% "play2-reactivemongo" % "0.10.5.0.akka23",


Cédric Chantepie

unread,
Jan 11, 2017, 3:13:01 AM1/11/17
to ReactiveMongo - http://reactivemongo.org
As indicated in the documentation, version 0.10 didn't support SSL. Best regards
Reply all
Reply to author
Forward
0 new messages