| 1708 | @unittest.skipIf(os.environ.get('PGHOST'), 'unmanaged cluster') |
| 1709 | async def test_connection_sslmode_no_ssl_server(self): |
| 1710 | async def verify_works(sslmode): |
| 1711 | con = None |
| 1712 | try: |
| 1713 | con = await self.connect( |
| 1714 | dsn='postgresql://foo/?sslmode=' + sslmode, |
| 1715 | user='postgres', |
| 1716 | database='postgres', |
| 1717 | host='localhost') |
| 1718 | self.assertEqual(await con.fetchval('SELECT 42'), 42) |
| 1719 | self.assertFalse(con._protocol.is_ssl) |
| 1720 | finally: |
| 1721 | if con: |
| 1722 | await con.close() |
| 1723 | |
| 1724 | async def verify_fails(sslmode): |
| 1725 | con = None |