mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
remove backport.ssl_match_hostname
This is already included in Python 3.5+
This commit is contained in:
parent
4771abf229
commit
7bae941ecc
@ -5,15 +5,15 @@ import sys
|
|||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
import binascii
|
import binascii
|
||||||
|
from ssl import match_hostname
|
||||||
|
from ssl import CertificateError
|
||||||
|
|
||||||
from typing import Optional # noqa
|
from typing import Optional # noqa
|
||||||
|
|
||||||
from mitmproxy.utils import strutils
|
from mitmproxy.utils import strutils
|
||||||
|
|
||||||
import certifi
|
import certifi
|
||||||
from backports import ssl_match_hostname
|
|
||||||
import OpenSSL
|
import OpenSSL
|
||||||
from OpenSSL import SSL
|
from OpenSSL import SSL
|
||||||
|
|
||||||
@ -726,8 +726,8 @@ class TCPClient(_Connection):
|
|||||||
hostname = sni
|
hostname = sni
|
||||||
else:
|
else:
|
||||||
hostname = "no-hostname"
|
hostname = "no-hostname"
|
||||||
ssl_match_hostname.match_hostname(crt, hostname)
|
match_hostname(crt, hostname)
|
||||||
except (ValueError, ssl_match_hostname.CertificateError) as e:
|
except (ValueError, CertificateError) as e:
|
||||||
self.ssl_verification_error = exceptions.InvalidCertificateException(
|
self.ssl_verification_error = exceptions.InvalidCertificateException(
|
||||||
"Certificate Verification Error for {}: {}".format(
|
"Certificate Verification Error for {}: {}".format(
|
||||||
sni or repr(self.address),
|
sni or repr(self.address),
|
||||||
|
1
setup.py
1
setup.py
@ -58,7 +58,6 @@ setup(
|
|||||||
# https://packaging.python.org/en/latest/requirements/#install-requires
|
# https://packaging.python.org/en/latest/requirements/#install-requires
|
||||||
# It is not considered best practice to use install_requires to pin dependencies to specific versions.
|
# It is not considered best practice to use install_requires to pin dependencies to specific versions.
|
||||||
install_requires=[
|
install_requires=[
|
||||||
"backports.ssl_match_hostname>=3.5.0.1, <3.6",
|
|
||||||
"blinker>=1.4, <1.5",
|
"blinker>=1.4, <1.5",
|
||||||
"click>=6.2, <7.0",
|
"click>=6.2, <7.0",
|
||||||
"certifi>=2015.11.20.1", # no semver here - this should always be on the last release!
|
"certifi>=2015.11.20.1", # no semver here - this should always be on the last release!
|
||||||
|
Loading…
Reference in New Issue
Block a user