use a regexp for the ssl bug workaround

This commit is contained in:
ThomasV 2013-10-08 13:24:54 +02:00
parent c45fa4860f
commit d2af935fc7
1 changed files with 1 additions and 1 deletions

View File

@ -327,7 +327,7 @@ class Interface(threading.Thread):
s.close()
cert = ssl.DER_cert_to_PEM_cert(dercert)
# workaround android bug
cert = cert.replace("==-----END CERTIFICATE-----", "==\n-----END CERTIFICATE-----")
cert = re.sub("([^\n])-----END CERTIFICATE-----","\\1\n-----END CERTIFICATE-----",cert)
temporary_path = cert_path + '.temp'
with open(temporary_path,"w") as f:
f.write(cert)