Getting ssl error while connecting monogoDb from laravel 5.2. Added the connection string in config/database.php file. I used jenssegers/mongodb.
Here is the configuration :
'connections' => [
'mongodb' => [
'driver' => 'mongodb',
'host' => ['hostname'],
'port' => 'port',
'database' => 'xxxx',
'username' => 'xxxx',
'password' => 'xxxx',
'options' => [
'ssl' => 'true',
'db' => 'xxx'
],
'driver_options' => [
'context' => stream_context_create([
'ssl' => [
'local_cert' => public_path().'/xxx.pem',
'cafile' => public_path().'/xxx.pem',
'allow_self_signed' => true,
'verify_peer' => true,
'verify_peer_name' => true,
'verify_expiry' => true,
]
])
]
]
],
And changed default connection in database.php
'default' => env('DB_CONNECTION', 'mongodb')
Whenever i tried this am getting the response like:Failed to connect to: Cannot setup SSL, is ext/openssl loaded?. openssl and ssl support are enabled in phpinfo().
Is there a way to solve it out?
Thanks