I’m encountering an issue while trying to connect to a SQL Server database using PHP Laravel on macOS with Brew. I’m receiving the following error message:
[Microsoft][ODBC Driver 17 for SQL Server] SSL Provider: [error:0A000102:SSL routines::unsupported protocol]
- Checked this GitHub issue: https://github.com/microsoft/msphpsql/issues/1462, but it didn’t resolve my problem.
- Switched from OpenSSL version 3 to OpenSSL version 1.1, which led to a different error.
Despite these efforts, I’m still unable to establish a successful connection to the SQL Server. Can anyone provide guidance on how to resolve this SSL protocol error and connect to the database successfully?
Operating System: macOS
Package Manager: Brew
PHP Framework: Laravel @9.x
PHP: https://github.com/shivammathur/homebrew-php @8.2 (with pdo_sqlsrv and sqlsrv extention)
This error encountered after brew update
as i remember
Any help or suggestions would be greatly appreciated. Thank you!
2
Answers
I had the same problem and this solved it for me :
[https://stackoverflow.com/questions/70042160/get-request-ssl-choose-client-versionunsupported-protocol][1]
if this still don’t work try to set this in your connection string :
Encrypt=no;TrustServerCertificate=yes
Don’t know if you already solved your problem, but i’ve encountered a few days ago tryng to connect php to a Microsoft SQL Server 2012 and solved it by changing to cipher statement in /etc/ssl/openssl.conf.
On ubuntu 22.04, that uses the newest version of openssl change the last line in /etc/ssl/openssl.conf to:
This cause a lesser standard of security and it will be recommended thinking about an upgrade to a newer version of Microsoft SQL server, but in the meantime you will be able to connect.
Bye.