Skip to content

Passing server_hostname=None doesn't actually work #18

@ivan-tkatchev

Description

@ivan-tkatchev
        self._extra.update(
            sslcontext=None,
            ssl_object=None,
            peername=self._rawsock.getpeername(),
            peer_hostname=peer_hostname,
            server_hostname=server_hostname
        )
        try:
            self._tls_conn.set_tlsext_host_name(
                self._extra["server_hostname"].encode("IDNA"))
        except KeyError:
            pass

There is always a server_hostname dictionary key, so checking for KeyError is pointless. You need something like if self._extra.get("server_hostname") instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions