CrafterCMS:通过SSL连接到MongoDB for Profile/Social



您如何配置Crafter Social和Profile以通过SSL连接到MongoDB?

在命令行上,我使用:

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

对于社交和个人资料,我们支持Mongodb Connection URI配置详细信息如下: https://docs.mongodb.com/manual/reference/connection-string/

要构建 X509 网址,您需要在网址中使用此参数ssl=true&?authMechanism=MONGODB-X509请注意用户名应为 x.509 证书派生的用户名,例如"CN=user, OU=OrgUnit,O=myOrg

在配置文件/社交中使用的内部MongoClient是使用此类构建的:http://api.mongodb.com/java/current/com/mongodb/MongoClientURI.html 将创建内部所需的MongoCredential.createMongoX509Credential(user);

以下是一些可能对您有所帮助的网址

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

相关内容

最新更新