0
我在使用SSL連接到mongoDb服務器時遇到問題。我嘗試用Symfony連接到serwer,沒有運氣,所以我開始去尋求更多的基本連接。我嘗試在PHP:MONGODB/PHP SSL連接問題 - TLS握手失敗
$mongo = new MongoDB\Driver\Manager("mongodb://USER:[email protected]:27017/admin", array(
'ssl' => true,
'sslAllowInvalidCertificates' => true
));
$command = new MongoDB\Driver\Command(['ping' => 1]);
$cursor = $mongo->executeCommand('admin', $command);
,我也得到:
No suitable servers found (`serverSelectionTryOnce` set): [TLS handshake failed: error:00000000:lib(0):func(0):reason(0) calling ismaster on 'HOST:27017']
所以我試圖用 「純」 蒙戈:
mongo admin --host HOST --ssl -u USER -p PASS --verbose
,但我得到:
MongoDB shell version: 2.4.10
Mon Jul 3 13:42:33.885 versionArrayTest passed
connecting to: HOST:27017/admin
Mon Jul 3 13:42:44.392 creating new connection to:HOST:27017
Mon Jul 3 13:42:44.421 BackgroundJob starting: ConnectBG
Mon Jul 3 13:42:44.472 ERROR: could not negotiate SSL connection: EOF detected
Mon Jul 3 13:42:44.473 Error: socket exception [CONNECT_ERROR] for at src/mongo/shell/mongo.js:147
Mon Jul 3 13:42:44.473 User Assertion: 12513:connect failed
exception: connect failed
經過幾個小時的搜索,我有點困惑 - 我改變了什麼d?我和DB管理員說話,他說其他用戶可以使用SSL連接,所以問題可以在我身邊。