mirror of
https://github.com/zhigang1992/mitmproxy.git
synced 2026-01-12 22:48:54 +08:00
do not return IP addresses in SSLCert.altnames
This commit is contained in:
@@ -478,7 +478,8 @@ class SSLCert(serializable.Serializable):
|
||||
continue
|
||||
for i in dec[0]:
|
||||
if i[0] is None and isinstance(i[1], univ.OctetString) and not isinstance(i[1], char.IA5String):
|
||||
e = b'.'.join([str(e).encode() for e in i[1].asNumbers()])
|
||||
# This would give back the IP address: b'.'.join([str(e).encode() for e in i[1].asNumbers()])
|
||||
continue
|
||||
else:
|
||||
e = i[0].asOctets()
|
||||
altnames.append(e)
|
||||
|
||||
@@ -136,7 +136,7 @@ class TestDummyCert:
|
||||
[b"one.com", b"two.com", b"*.three.com", b"127.0.0.1"]
|
||||
)
|
||||
assert r.cn == b"foo.com"
|
||||
assert r.altnames == [b'one.com', b'two.com', b'*.three.com', b'127.0.0.1']
|
||||
assert r.altnames == [b'one.com', b'two.com', b'*.three.com']
|
||||
|
||||
r = certs.dummy_cert(
|
||||
ca.default_privatekey,
|
||||
|
||||
Reference in New Issue
Block a user