(self)
| 1229 | |
| 1230 | @gen_test |
| 1231 | async def test_no_match(self): |
| 1232 | stream = SSLIOStream(socket.socket(), ssl_options=self.client_ssl_ctx) |
| 1233 | with ExpectLog( |
| 1234 | gen_log, |
| 1235 | ".*alert bad certificate", |
| 1236 | level=logging.WARNING, |
| 1237 | required=platform.system() != "Windows", |
| 1238 | ): |
| 1239 | with self.assertRaises(ssl.SSLCertVerificationError): |
| 1240 | with ExpectLog( |
| 1241 | gen_log, |
| 1242 | ".*(certificate verify failed: Hostname mismatch)", |
| 1243 | level=logging.WARNING, |
| 1244 | ): |
| 1245 | await stream.connect( |
| 1246 | ("127.0.0.1", self.port), |
| 1247 | server_hostname="bar.example.com", |
| 1248 | ) |
| 1249 | # The server logs a warning while cleaning up the failed connection. |
| 1250 | # Unfortunately there's no good hook to wait for this logging. |
| 1251 | # It doesn't seem to happen on windows; I'm not sure why. |
| 1252 | if platform.system() != "Windows": |
| 1253 | await asyncio.sleep(0.1) |
| 1254 | |
| 1255 | @gen_test |
| 1256 | async def test_check_disabled(self): |
nothing calls this directly
no test coverage detected