'The ``ssl_options`` keyword argument may either be a dictionary
of keywords arguments for `ssl.wrap_socket`, or an `ssl.SSLContext`
object.'

def __init__(self, *args, **kwargs):

    self._ssl_options = kwargs.pop('ssl_options', {})
    super(SSLIOStream, self).__init__(*args, **kwargs)
    self._ssl_accepting = True
    self._handshake_reading = False
    self._handshake_writing = False
    self._ssl_connect_callback = None
    self._server_hostname = None
    try:
        self.socket.getpeername()
    except socket.error:
        pass
    else:
        self._add_io_state(self.io_loop.WRITE)
