aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy
diff options
context:
space:
mode:
authorThomas Kriechbaumer <thomas@kriechbaumer.name>2018-01-06 10:43:33 +0100
committerThomas Kriechbaumer <thomas@kriechbaumer.name>2018-01-06 10:43:54 +0100
commitd15e96dee1d6c3c752434663bf6ea8a547d09d28 (patch)
tree6d78fd9542ab5b6417a73f8ec2d7f937d12605d5 /mitmproxy
parent9aae3213b9ebaa1ba1d23790fe4ccc5e03140cf4 (diff)
downloadmitmproxy-d15e96dee1d6c3c752434663bf6ea8a547d09d28.tar.gz
mitmproxy-d15e96dee1d6c3c752434663bf6ea8a547d09d28.tar.bz2
mitmproxy-d15e96dee1d6c3c752434663bf6ea8a547d09d28.zip
rename TLS/SSL-related functions
SSL is an outdated protocol superseeded by TLS. Although the commonly used library is called OpenSSL, it is no reason to still use outdated language for function names.
Diffstat (limited to 'mitmproxy')
-rw-r--r--mitmproxy/certs.py2
-rw-r--r--mitmproxy/connections.py8
-rw-r--r--mitmproxy/net/tcp.py4
-rw-r--r--mitmproxy/proxy/protocol/http_replay.py4
-rw-r--r--mitmproxy/proxy/protocol/tls.py4
5 files changed, 11 insertions, 11 deletions
diff --git a/mitmproxy/certs.py b/mitmproxy/certs.py
index c29d67f3..594a33aa 100644
--- a/mitmproxy/certs.py
+++ b/mitmproxy/certs.py
@@ -436,7 +436,7 @@ class SSLCert(serializable.Serializable):
Returns:
All DNS altnames.
"""
- # tcp.TCPClient.convert_to_ssl assumes that this property only contains DNS altnames for hostname verification.
+ # tcp.TCPClient.convert_to_tls assumes that this property only contains DNS altnames for hostname verification.
altnames = []
for i in range(self.x509.get_extension_count()):
ext = self.x509.get_extension(i)
diff --git a/mitmproxy/connections.py b/mitmproxy/connections.py
index 7cc50f66..290782c2 100644
--- a/mitmproxy/connections.py
+++ b/mitmproxy/connections.py
@@ -127,8 +127,8 @@ class ClientConnection(tcp.BaseHandler, stateobject.StateObject):
tls_version=None,
))
- def convert_to_ssl(self, cert, *args, **kwargs):
- super().convert_to_ssl(cert, *args, **kwargs)
+ def convert_to_tls(self, cert, *args, **kwargs):
+ super().convert_to_tls(cert, *args, **kwargs)
self.timestamp_tls_setup = time.time()
self.mitmcert = cert
sni = self.connection.get_servername()
@@ -261,7 +261,7 @@ class ServerConnection(tcp.TCPClient, stateobject.StateObject):
self.wfile.write(message)
self.wfile.flush()
- def establish_ssl(self, clientcerts, sni, **kwargs):
+ def establish_tls(self, clientcerts, sni, **kwargs):
if sni and not isinstance(sni, str):
raise ValueError("sni must be str, not " + type(sni).__name__)
clientcert = None
@@ -275,7 +275,7 @@ class ServerConnection(tcp.TCPClient, stateobject.StateObject):
if os.path.exists(path):
clientcert = path
- self.convert_to_ssl(cert=clientcert, sni=sni, **kwargs)
+ self.convert_to_tls(cert=clientcert, sni=sni, **kwargs)
self.sni = sni
self.alpn_proto_negotiated = self.get_alpn_proto_negotiated()
self.tls_version = self.connection.get_protocol_version_name()
diff --git a/mitmproxy/net/tcp.py b/mitmproxy/net/tcp.py
index 2a456ba0..5fa91ae5 100644
--- a/mitmproxy/net/tcp.py
+++ b/mitmproxy/net/tcp.py
@@ -381,7 +381,7 @@ class TCPClient(_Connection):
else:
close_socket(self.connection)
- def convert_to_ssl(self, sni=None, alpn_protos=None, **sslctx_kwargs):
+ def convert_to_tls(self, sni=None, alpn_protos=None, **sslctx_kwargs):
context = tls.create_client_context(
alpn_protos=alpn_protos,
sni=sni,
@@ -491,7 +491,7 @@ class BaseHandler(_Connection):
self.server = server
self.clientcert = None
- def convert_to_ssl(self, cert, key, **sslctx_kwargs):
+ def convert_to_tls(self, cert, key, **sslctx_kwargs):
"""
Convert connection to SSL.
For a list of parameters, see tls.create_server_context(...)
diff --git a/mitmproxy/proxy/protocol/http_replay.py b/mitmproxy/proxy/protocol/http_replay.py
index cc22c0b7..022e8133 100644
--- a/mitmproxy/proxy/protocol/http_replay.py
+++ b/mitmproxy/proxy/protocol/http_replay.py
@@ -75,7 +75,7 @@ class RequestReplayThread(basethread.BaseThread):
)
if resp.status_code != 200:
raise exceptions.ReplayException("Upstream server refuses CONNECT request")
- server.establish_ssl(
+ server.establish_tls(
self.options.client_certs,
sni=self.f.server_conn.sni
)
@@ -90,7 +90,7 @@ class RequestReplayThread(basethread.BaseThread):
)
server.connect()
if r.scheme == "https":
- server.establish_ssl(
+ server.establish_tls(
self.options.client_certs,
sni=self.f.server_conn.sni
)
diff --git a/mitmproxy/proxy/protocol/tls.py b/mitmproxy/proxy/protocol/tls.py
index afe9b78c..ed0a96bb 100644
--- a/mitmproxy/proxy/protocol/tls.py
+++ b/mitmproxy/proxy/protocol/tls.py
@@ -487,7 +487,7 @@ class TlsLayer(base.Layer):
extra_certs = None
try:
- self.client_conn.convert_to_ssl(
+ self.client_conn.convert_to_tls(
cert, key,
method=self.config.openssl_method_client,
options=self.config.openssl_options_client,
@@ -543,7 +543,7 @@ class TlsLayer(base.Layer):
ciphers_server.append(CIPHER_ID_NAME_MAP[id])
ciphers_server = ':'.join(ciphers_server)
- self.server_conn.establish_ssl(
+ self.server_conn.establish_tls(
self.config.client_certs,
self.server_sni,
method=self.config.openssl_method_server,