mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
take idna implementation from twisted
This commit is contained in:
parent
26651b0d6a
commit
95341a8f6f
@ -13,8 +13,8 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import idna
|
|
||||||
from OpenSSL import SSL, crypto
|
from OpenSSL import SSL, crypto
|
||||||
|
from twisted.internet._idna import _idnaBytes
|
||||||
from twisted.internet.ssl import ContextFactory, CertificateOptions
|
from twisted.internet.ssl import ContextFactory, CertificateOptions
|
||||||
from twisted.internet._sslverify import _defaultCurveName, _tolerateErrors
|
from twisted.internet._sslverify import _defaultCurveName, _tolerateErrors
|
||||||
from twisted.internet.interfaces import IOpenSSLClientConnectionCreator
|
from twisted.internet.interfaces import IOpenSSLClientConnectionCreator
|
||||||
@ -63,7 +63,7 @@ class ClientTLSOptions(object):
|
|||||||
def __init__(self, hostname, ctx):
|
def __init__(self, hostname, ctx):
|
||||||
self._ctx = ctx
|
self._ctx = ctx
|
||||||
self._hostname = hostname
|
self._hostname = hostname
|
||||||
self._hostnameBytes = idna.encode(hostname)
|
self._hostnameBytes = _idnaBytes(hostname)
|
||||||
ctx.set_info_callback(
|
ctx.set_info_callback(
|
||||||
_tolerateErrors(self._identityVerifyingInfoCallback)
|
_tolerateErrors(self._identityVerifyingInfoCallback)
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user