Skip to content

Commit 7df9812

Browse files
authored
Fix test_tls_version for LibreSSL (#974)
Context: python/cpython#78182
1 parent 9cb2c1c commit 7df9812

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tests/test_connect.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -1497,13 +1497,14 @@ async def test_tls_version(self):
14971497
'&ssl_min_protocol_version=TLSv1.1'
14981498
'&ssl_max_protocol_version=TLSv1.1'
14991499
)
1500-
with self.assertRaisesRegex(ssl.SSLError, 'no protocols'):
1501-
await self.connect(
1502-
dsn='postgresql://ssl_user@localhost/postgres'
1503-
'?sslmode=require'
1504-
'&ssl_min_protocol_version=TLSv1.2'
1505-
'&ssl_max_protocol_version=TLSv1.1'
1506-
)
1500+
if not ssl.OPENSSL_VERSION.startswith('LibreSSL'):
1501+
with self.assertRaisesRegex(ssl.SSLError, 'no protocols'):
1502+
await self.connect(
1503+
dsn='postgresql://ssl_user@localhost/postgres'
1504+
'?sslmode=require'
1505+
'&ssl_min_protocol_version=TLSv1.2'
1506+
'&ssl_max_protocol_version=TLSv1.1'
1507+
)
15071508
con = await self.connect(
15081509
dsn='postgresql://ssl_user@localhost/postgres'
15091510
'?sslmode=require'

0 commit comments

Comments
 (0)