Esempio n. 1
0
    def peer_hostname(self) -> str:
        """Manage the expected name of the remote peer.

        The hostname is used for two purposes:

            1. when set on an SSL client, it is sent to the server during the
               handshake (if Server Name Indication is supported)
            2. it is used to check against the identifying name provided in the
               peer's certificate. If the supplied name does not exactly match a
               SubjectAltName (type DNS name), or the CommonName entry in the
               peer's certificate, the peer is considered unauthenticated
               (potential imposter), and the SSL connection is aborted.

        .. note:: Verification of the hostname is only done if
            :const:`SSLDomain.VERIFY_PEER_NAME` is set using
            :meth:`SSLDomain.set_peer_authentication`."""
        err, name = pn_ssl_get_peer_hostname(self._ssl, 1024)
        self._check(err)
        return utf82unicode(name)
Esempio n. 2
0
 def _get_peer_hostname(self):
     err, name = pn_ssl_get_peer_hostname(self._ssl, 1024)
     self._check(err)
     return utf82unicode(name)
Esempio n. 3
0
 def _get_peer_hostname(self):
     err, name = pn_ssl_get_peer_hostname(self._ssl, 1024)
     self._check(err)
     return utf82unicode(name)