2

How do you configure Crafter Social and Profile to connect to MongoDB over SSL?

On command line I use:

mongo "mongodb://acme:password@mongodb-url:27017/acmesocial?ssl=true&sslCAFile=/etc/ssl/mongodb-dev-server.pem&sslPEMKeyFile=/etc/ssl/mongodb-dev-clients.pem&sslPEMKeyPassword=acme+dev+mongodb+slaves" --verbose

1 Answers1

1

For both Social and Profile we support Mongodb Connection URI configuration details are here: https://docs.mongodb.com/manual/reference/connection-string/

To build a X509 url you need this param in your url ssl=true&?authMechanism=MONGODB-X509 please notice that the username should be The x.509 certificate derived username, e.g. "CN=user, OU=OrgUnit,O=myOrg

The internal MongoClient that is used in Profile/Social is build using this class: http://api.mongodb.com/java/current/com/mongodb/MongoClientURI.html that will create the internally needed MongoCredential.createMongoX509Credential(user);

Here are some URLs that might help you

http://mongodb.github.io/mongo-java-driver/3.0/driver/reference/connecting/authenticating/#x-509

https://www.ibm.com/support/knowledgecenter/SSB23S_1.1.0.13/gtpd5/tmdbssljava.html

https://github.com/mongodb/mongo-java-driver/blob/3770623f7051634daa978c265a3b03fe04fee913/docs/reference/content/driver/tutorials/authentication.md#x509

https://docs.mongodb.com/manual/tutorial/configure-x509-client-authentication/#add-x-509-certificate-subject-as-a-user

Cortiz
  • 839
  • 4
  • 7