diff --git a/CHANGELOG.md b/CHANGELOG.md index c6438cc..aee5b6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.27.4 (May 14th, 2026) + +BUG FIXES: +* Fix compatibility with Twisted 26 and TLS certificate validation. + ## 0.27.3 (February 17th, 2026) ENHANCEMENTS: diff --git a/ns1/__init__.py b/ns1/__init__.py index aa56d58..21703d5 100644 --- a/ns1/__init__.py +++ b/ns1/__init__.py @@ -5,7 +5,7 @@ # from .config import Config -version = "0.27.3" +version = "0.27.4" class NS1: diff --git a/ns1/rest/transport/twisted.py b/ns1/rest/transport/twisted.py index 2ff8d92..02ada9b 100644 --- a/ns1/rest/transport/twisted.py +++ b/ns1/rest/transport/twisted.py @@ -34,7 +34,6 @@ from twisted.web.http_headers import Headers from twisted.internet.defer import succeed from twisted.internet.ssl import CertificateOptions - from twisted.internet._sslverify import ClientTLSOptions from twisted.web.iweb import IPolicyForHTTPS from zope.interface import implementer @@ -83,21 +82,10 @@ def stopProducing(self): if have_twisted: - - class IgnoreHostnameClientTLSOptions(ClientTLSOptions): - def _identityVerifyingInfoCallback(self, connection, where, ret): - # override hostname validation - - return - @implementer(IPolicyForHTTPS) class NoValidationPolicy(object): def creatorForNetloc(self, hostname, port): - options = CertificateOptions(trustRoot=None) - ascii_hostname = hostname.decode("ascii") - context = options.getContext() - - return IgnoreHostnameClientTLSOptions(ascii_hostname, context) + return CertificateOptions(trustRoot=None) class TwistedTransport(TransportBase):