(socket, server_hostname, context)
| 234 | # Server can also return different server certificate depending which |
| 235 | # hostname the client uses. Requires Python 3.7 or later. |
| 236 | def sni_callback(socket, server_hostname, context): |
| 237 | if server_hostname == "foo.127.0.0.1.nip.io": |
| 238 | new_context = default_ssl_context_factory() |
| 239 | new_context.load_cert_chain(certfile="foo.pem", keyfile="foo-key.pem") |
| 240 | socket.context = new_context |
| 241 | |
| 242 | context.sni_callback = sni_callback |
| 243 |
nothing calls this directly
no test coverage detected