【问题标题】:CrafterCMS: connecting to MongoDB over SSL for Profile/SocialCrafterCMS:通过 SSL 连接到 MongoDB 用于个人资料/社交
【发布时间】:2017-05-24 20:53:11
【问题描述】:

如何配置 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

【问题讨论】:

    标签: crafter-cms


    【解决方案1】:

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

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

    Profile/Social 中使用的内部 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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-10-25
      • 2015-03-03
      • 1970-01-01
      • 1970-01-01
      • 2014-08-14
      • 2018-08-23
      • 1970-01-01
      相关资源
      最近更新 更多