The ``ssl_options`` keyword argument may either be an `ssl.SSLContext` object or a dictionary of keywords arguments for `ssl.SSLContext.wrap_socket`
(self, *args: Any, **kwargs: Any)
| 1327 | socket = None # type: ssl.SSLSocket |
| 1328 | |
| 1329 | def __init__(self, *args: Any, **kwargs: Any) -> None: |
| 1330 | """The ``ssl_options`` keyword argument may either be an |
| 1331 | `ssl.SSLContext` object or a dictionary of keywords arguments |
| 1332 | for `ssl.SSLContext.wrap_socket` |
| 1333 | """ |
| 1334 | self._ssl_options = kwargs.pop("ssl_options", _client_ssl_defaults) |
| 1335 | super().__init__(*args, **kwargs) |
| 1336 | self._ssl_accepting = True |
| 1337 | self._handshake_reading = False |
| 1338 | self._handshake_writing = False |
| 1339 | self._server_hostname = None # type: Optional[str] |
| 1340 | |
| 1341 | # If the socket is already connected, attempt to start the handshake. |
| 1342 | try: |
| 1343 | self.socket.getpeername() |
| 1344 | except OSError: |
| 1345 | pass |
| 1346 | else: |
| 1347 | # Indirectly start the handshake, which will run on the next |
| 1348 | # IOLoop iteration and then the real IO state will be set in |
| 1349 | # _handle_events. |
| 1350 | self._add_io_state(self.io_loop.WRITE) |
| 1351 | |
| 1352 | def reading(self) -> bool: |
| 1353 | return self._handshake_reading or super().reading() |
nothing calls this directly
no test coverage detected