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

Lines changed: 8 additions & 7 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy