[ODBC Driver 17 for SQL Server]SSL Provider: [error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol]

Viewed 9479

os: ubuntu 20.04

server SQL server version: Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (Intel X86)

python 3.8

import pyodbc
cnxn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};SERVER='+server+';DATABASE='+database+';UID='+username+';PWD='+ password)

Error:
[Microsoft][ODBC Driver 17 for SQL Server]SSL Provider: [error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol] (-1) (SQLDriverConnect)')

I try to modify openssl.conf:

oid_section             = new_oids

openssl_conf = default_conf

[default_conf]
ssl_conf = ssl_sect

[ssl_sect]
system_default = system_default_sect

[system_default_sect]
MinProtocol = TLSv1.1
CipherString = DEFAULT@SECLEVEL=1

then reboot

but it cant work.

4 Answers

This might be the right approach, but I think you should lower the protocol to TLSv1.0

[system_default_sect]
MinProtocol = TLSv1.0
CipherString = DEFAULT@SECLEVEL=1

I just hit this problem trying to connect from a Debian 10 with openssl 1.1.1d to a Windows Server 2008 with MSSQL 12 Express.

Lowering the protocol version works directly, no reboot needed.

step1:

nano /etc/ssl/openssl.cnf

# Extra OBJECT IDENTIFIER info:
#oid_file               = $ENV::HOME/.oid
oid_section             = new_oids

openssl_conf = default_conf

[default_conf]
ssl_conf = ssl_sect

[ssl_sect]
system_default = system_default_sect

[system_default_sect]
MinProtocol = TLSv1.0
CipherString = DEFAULT@SECLEVEL=1

step2:

The manual installation looks like:

wget https://www.openssl.org/source/latest.tar.gz -O openssl-1.1.1h.tar.gz
tar -zxvf openssl-1.1.1h.tar.gz
cd openssl-1.1.1h
./config
make
sudo make install
openssl version
sudo ldconfig

reference:

https://askubuntu.com/questions/1284658/how-to-fix-microsoft-odbc-driver-17-for-sql-server-ssl-provider-ssl-choose-cli

Look for 1.1.1m.tar.gz - this is the latest.

Related