summary refs log tree commit diff
diff options
context:
space:
mode:
authorJeroen <vo.jeroen@gmail.com>2018-06-26 21:15:14 +0200
committerJeroen <vo.jeroen@gmail.com>2018-06-26 21:15:14 +0200
commit95341a8f6f9c3b7ebcb3a428de65b18740234f3e (patch)
tree443aecba7ccb47d9bb35fe3a5ad75ddbf137334a
parenttowncrier changelog (diff)
downloadsynapse-95341a8f6f9c3b7ebcb3a428de65b18740234f3e.tar.xz
take idna implementation from twisted
-rw-r--r--synapse/crypto/context_factory.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/crypto/context_factory.py b/synapse/crypto/context_factory.py
index e93afbf975..57694e18b0 100644
--- a/synapse/crypto/context_factory.py
+++ b/synapse/crypto/context_factory.py
@@ -13,8 +13,8 @@
 # limitations under the License.
 import logging
 
-import idna
 from OpenSSL import SSL, crypto
+from twisted.internet._idna import _idnaBytes
 from twisted.internet.ssl import ContextFactory, CertificateOptions
 from twisted.internet._sslverify import _defaultCurveName, _tolerateErrors
 from twisted.internet.interfaces import IOpenSSLClientConnectionCreator
@@ -63,7 +63,7 @@ class ClientTLSOptions(object):
     def __init__(self, hostname, ctx):
         self._ctx = ctx
         self._hostname = hostname
-        self._hostnameBytes = idna.encode(hostname)
+        self._hostnameBytes = _idnaBytes(hostname)
         ctx.set_info_callback(
             _tolerateErrors(self._identityVerifyingInfoCallback)
         )