workaround android bug with ssl certificates

This commit is contained in:
ThomasV 2013-10-08 13:08:13 +02:00
parent 87a8bfda47
commit f858f69c56
1 changed files with 2 additions and 0 deletions

View File

@ -326,6 +326,8 @@ class Interface(threading.Thread):
dercert = s.getpeercert(True)
s.close()
cert = ssl.DER_cert_to_PEM_cert(dercert)
# workaround android bug
cert = cert.replace("==-----END CERTIFICATE-----", "==\n-----END CERTIFICATE-----")
temporary_path = cert_path + '.temp'
with open(temporary_path,"w") as f:
f.write(cert)