我使用以下命令启动MongoDB(我最终将其添加到脚本中):
mongod --sslMode requireSSL --sslPEMKeyFile ./certs/myCertAndKey.pem
之后,mongo会提示:
输入PEM密码
哪个好,但在输入正确的密码后,它会再次询问。然后再次。
Mongo连续五次要求输入PEM密码! 我知道我正确输入密码,因为如果我输错了一次,我就会收到失败的消息。
这是正常的吗?除了从pem文件中删除密码之外,有没有办法简化这个?
我的最终目标是让我的Spring启动应用程序启动本地MongoDB并使用SSL,如果它还没有运行,但是要求输入密码5次是荒谬的。
版本信息:
答案 0 :(得分:1)
您可能需要通过指定PEMKeyPassword
来禁用密码短语提示要使用配置文件启动mongod,可以使用以下命令:
mongod --config /etc/mongod.conf
您需要在以下结构中指定 PEMKeyPassword :
net:
port: <int>
bindIp: <string>
maxIncomingConnections: <int>
wireObjectCheck: <boolean>
ipv6: <boolean>
unixDomainSocket:
enabled: <boolean>
pathPrefix: <string>
filePermissions: <int>
http:
enabled: <boolean>
JSONPEnabled: <boolean>
RESTInterfaceEnabled: <boolean>
ssl:
sslOnNormalPorts: <boolean> # deprecated since 2.6
mode: <string>
PEMKeyFile: <string>
PEMKeyPassword: <string>
clusterFile: <string>
clusterPassword: <string>
CAFile: <string>
CRLFile: <string>
allowConnectionsWithoutCertificates: <boolean>
allowInvalidCertificates: <boolean>
allowInvalidHostnames: <boolean>
disabledProtocols: <string>
FIPSMode: <boolean>
compression:
compressors: <string>