aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/certs.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2019-11-11 18:35:06 +0100
committerMaximilian Hils <git@maximilianhils.com>2019-11-11 18:35:06 +0100
commitf97996126f7a7606f8601f0318f0a70a4e818c6c (patch)
tree693148a4e729893c9e4f6245d191d7b14a576690 /mitmproxy/certs.py
parent3af4647804700bb6e86a9e1b73d7bf8612d872fa (diff)
downloadmitmproxy-f97996126f7a7606f8601f0318f0a70a4e818c6c.tar.gz
mitmproxy-f97996126f7a7606f8601f0318f0a70a4e818c6c.tar.bz2
mitmproxy-f97996126f7a7606f8601f0318f0a70a4e818c6c.zip
minor improvements and sans-io adjustments
Diffstat (limited to 'mitmproxy/certs.py')
-rw-r--r--mitmproxy/certs.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/mitmproxy/certs.py b/mitmproxy/certs.py
index 65dc50e4..e702e1cf 100644
--- a/mitmproxy/certs.py
+++ b/mitmproxy/certs.py
@@ -123,7 +123,7 @@ def dummy_cert(privkey, cacert, commonname, sans, organization):
)
])
cert.set_pubkey(cacert.get_pubkey())
- cert.sign(privkey, "sha256")
+ cert.sign(privkey, b"sha256")
return Cert(cert)
@@ -315,7 +315,12 @@ class CertStore:
ret.append(b"*." + b".".join(parts[i:]))
return ret
- def get_cert(self, commonname: typing.Optional[bytes], sans: typing.List[bytes], organization: typing.Optional[bytes] = None):
+ def get_cert(
+ self,
+ commonname: typing.Optional[bytes],
+ sans: typing.List[bytes],
+ organization: typing.Optional[bytes] = None
+ ) -> typing.Tuple["Cert", OpenSSL.SSL.PKey, str]:
"""
Returns an (cert, privkey, cert_chain) tuple.