Getting error message while connecting to database using Laravel 5.4 and Mongodb 3.6
The "SCRAM-SHA-1" authentication mechanism requires libmongoc built with --enable-ssl
Its running fine in ubuntu 16.04 with same versions, but not in AWS Linux.
Installed LAMP [ php70, apach24 ] :
Installed Mongodb [ 3.6 ] :
Installed php-mongodb driver for php7:
sudo yum -y install php7-pear php70-devel gcc // completed
sudo pecl7 install mongodb // completed
sudo yum install openssl-devel // completed
php-mongodb driver installed and updated to php.ini, mongodb shows in phpinfo() as well.
we find there is libmongoc ssl disabled from phpinfo, Is that issue ?
How can we enable it ?
Salted Challenge Response Authentication Mechanism (SCRAM) is a password-based mutual authentication protocol designed to make an eavesdropping attack (i.e. man-in-the-middle) more difficult.
There are significant security concerns with that mechanism, which could be addressed by the use of a challenge response authentication mechanism protected by TLS." This means that implementing SCRAM with SHA-1 won't add any extra protection for passwords transmitted through TLS.
On Ubuntu 18.04 LTS, PHP 7.2.7
I had to install some extra packages:
sudo apt-get install -y libcurl4-openssl-dev pkg-config libssl-dev
Then re-install mongodb:
sudo pecl uninstall mongodb
sudo pecl install mongodb
Then check that SSL is enabled:
php -i | grep mongo
/etc/php/7.2/cli/conf.d/20-mongodb.ini, mongodb
libmongoc bundled version => 1.11.0 libmongoc SSL => enabled libmongoc SSL library => OpenSSL libmongoc crypto => enabled libmongoc crypto library => libcrypto
Restart php:
sudo service php7.2-fpm restart
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With