diff --git a/tests/test_connect.py b/tests/test_connect.py index 4903fc03..7707a1c9 100644 --- a/tests/test_connect.py +++ b/tests/test_connect.py @@ -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'