Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The "SCRAM-SHA-1" authentication mechanism requires libmongoc built with --enable-ssl

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 ] :

  • https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html

Installed Mongodb [ 3.6 ] :

  • https://docs.mongodb.com/manual/tutorial/install-mongodb-on-amazon/

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 ?

enter image description here

How can we enable it ?

like image 352
151291 Avatar asked May 26 '18 10:05

151291


People also ask

What is SCRAM SHA authentication?

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.

Is SCRAM SHA-1 secure?

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.


1 Answers

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
like image 113
Jannie Theunissen Avatar answered Nov 15 '22 06:11

Jannie Theunissen