Thursday, 16 March 2017

MongoDB complaining about SSL handshake when SSL connection attempt is not being made

I've tried using both the official mongo Docker image as well as khezen/mongo, and I get the same error message when I try to make an unencrypted HTTP connection:

AssertionException handling request, closing client connection: 17133 SSL handshake requested, SSL feature not available in this build

That's the message from khezen/mongo. The official mongo image gives a slightly different error:

AssertionException handling request, closing client connection: 17132 SSL handshake received but server is started without SSL support

And when the official mongo image is started from a docker-compose.yml with a custom command (mongod --sslMode allowSSL --sslPEMKeyFile /data/db/mongodb.pem):

SSL: error:1407609C:SSL routines:SSL23_GET_CLIENT_HELLO:http request

Now, this is all while trying to make the following request from Postman:

Mode: POST

URL: http://localhost:27017/lasdf?client=asdf

Data payload: { "gargen": "flagren", "jiminy": { "crickets": 1, "isChirping": false }, "blargen": "fargle", "_id": "a96c2a4ec6fb4a8dbe2305687eb0e50b" }

Interestingly, when I change the 'http' to 'https' I get no error message, but also no response, and of course the database is not changed.

Stranger still, I am able to access the database via the mongo-express docker image. Its default configuration does not do HTTPS requests to mongodb, because when I change my custom command to '--sslMode requireSSL' it fails to connect.

The version of MongoDB installed in the container is 3.4.2.



via user3758236

No comments:

Post a Comment