Skip to content

Commit

Permalink
Fix test_tls_version for LibreSSL (MagicStack#974)
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberTailor committed Dec 3, 2022
1 parent 9cb2c1c commit 7df9812
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tests/test_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -1497,13 +1497,14 @@ async def test_tls_version(self):
'&ssl_min_protocol_version=TLSv1.1'
'&ssl_max_protocol_version=TLSv1.1'
)
with self.assertRaisesRegex(ssl.SSLError, 'no protocols'):
await self.connect(
dsn='postgresql://ssl_user@localhost/postgres'
'?sslmode=require'
'&ssl_min_protocol_version=TLSv1.2'
'&ssl_max_protocol_version=TLSv1.1'
)
if not ssl.OPENSSL_VERSION.startswith('LibreSSL'):
with self.assertRaisesRegex(ssl.SSLError, 'no protocols'):
await self.connect(
dsn='postgresql://ssl_user@localhost/postgres'
'?sslmode=require'
'&ssl_min_protocol_version=TLSv1.2'
'&ssl_max_protocol_version=TLSv1.1'
)
con = await self.connect(
dsn='postgresql://ssl_user@localhost/postgres'
'?sslmode=require'
Expand Down

0 comments on commit 7df9812

Please sign in to comment.