Browse Source

use a regexp for the ssl bug workaround

283
ThomasV 11 years ago
parent
commit
d2af935fc7
  1. 2
      lib/interface.py

2
lib/interface.py

@ -327,7 +327,7 @@ class Interface(threading.Thread):
s.close() s.close()
cert = ssl.DER_cert_to_PEM_cert(dercert) cert = ssl.DER_cert_to_PEM_cert(dercert)
# workaround android bug # 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' temporary_path = cert_path + '.temp'
with open(temporary_path,"w") as f: with open(temporary_path,"w") as f:
f.write(cert) f.write(cert)

Loading…
Cancel
Save