-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQLSTATE[08001]: [Microsoft][ODBC Driver 18 for SQL Server]SSL Provider: [error:0A000102:SSL routines::unsupported protocol] #1462
Comments
What's the version of OpenSSL on the machine ( |
openssl version is 3.1.1 |
"unsupported protocol" sounds like it's trying to use TLS 1.0 or 1.1, which newer OpenSSL doesn't allow by default. I believe basic SQL Server 14 doesn't support TLS 1.2, so potential solutions would be to allow lower security in OpenSSL config on the client or patch the server with a service pack that has TLS 1.2 support. Also, you can try connecting to a newer SQL Server if you have one available to verify my theory. |
Hello makouz, thank you very much. My database is an educational version. Based on your suggestion, I downloaded the patch SQLServer2014SP3-KB4022619-x64, restarted the server, and now I can connect normally |
i have the same issue , so the soluiton would be downgrade the openssl version ? |
@safwanAzman If updating the server isn't an option, you can configure OpenSSL to use old TLS: For example: at the top of
And at the bottom:
On Linux |
@v-makouz I tried to configure the openssl_conf = default_conf
[ req ]
#default_bits = 2048
#default_md = sha256
#default_keyfile = privkey.pem
distinguished_name = req_distinguished_name
attributes = req_attributes
[ req_distinguished_name ]
countryName = Country Name (2 letter code)
countryName_min = 2
countryName_max = 2
stateOrProvinceName = State or Province Name (full name)
localityName = Locality Name (eg, city)
0.organizationName = Organization Name (eg, company)
organizationalUnitName = Organizational Unit Name (eg, section)
commonName = Common Name (eg, fully qualified host name)
commonName_max = 64
emailAddress = Email Address
emailAddress_max = 64
[ req_attributes ]
challengePassword = A challenge password
challengePassword_min = 4
challengePassword_max = 20
[default_conf]
ssl_conf = ssl_sect
[ssl_sect]
system_default = system_default_sect
[system_default_sect]
MinProtocol = TLSv1.1
CipherString = DEFAULT@SECLEVEL=0
[openssl_init]
providers = provider_sect The version of my OpenSSL is So do I need to downgrade my OpenSSL as well? |
I've seen sometimes there were several |
You can refer to it
|
It doesn't really work. I have PHP 8.3 on MacOS, and from php -i I confirmed the path of openssl.cnf. |
@CaledoniaProject Try directly overwriting the file |
@tw2066 It won't work. For people who stuck on this, just update your SQLServer to a newer SP, TLSv1.2 will be automatically supported. |
Does anyone have an answer? |
This is not a PHP driver issue, but rather compatibility between OpenSSL and SQL Server. Starting with OpenSSL 3.0 TLSv1.0 and TLSv1.1 were deprecated and are not allowed by default, requiring at least TLSv1.2. Many older servers don't have TLSv1.2, thus the connection fails. The ideal solution is to patch or upgrade the server. If that's not possible, one can configure OpenSSL to still allow use of older protocols, but it's best to consult OpenSSL documentation or support for the most up to date instructions for how to do so. |
thx your solution. |
Please check the FAQ (frequently-asked questions) first. If you have other questions or something to report, please address the following (skipping questions might delay our responses):
PHP version
8.2.8
PHP SQLSRV or PDO_SQLSRV version
5.11.0
Microsoft ODBC Driver version
2.3.11
SQL Server version
sqlserver2014
Client operating system
macOs ventura 13.4.1
Table schema
Problem description
Using Brew to install the latest PHP has been causing this issue all the time. I don't know if it is related to the PHP version, but after looking at many solutions, it has not been successful. I would like to ask for advice on how to end this issue
Expected behavior and actual behavior
Repro code or steps to reproduce
The text was updated successfully, but these errors were encountered: