1
0

simplify x509 constructor

This commit is contained in:
ThomasV
2015-08-07 11:39:30 +02:00
parent 713fa00d86
commit ca3c320ef4
3 changed files with 5 additions and 9 deletions

View File

@@ -201,8 +201,7 @@ class TcpInterface(threading.Thread):
with open(cert_path) as f:
cert = f.read()
try:
x = x509.X509()
x.parseBinary(cert)
x = x509.X509(cert)
except:
traceback.print_exc(file=sys.stderr)
self.print_error("wrong certificate")
@@ -343,8 +342,7 @@ def check_host_name(peercert, name):
def check_cert(host, cert):
try:
x = x509.X509()
x.parseBinary(cert)
x = x509.X509(cert)
except:
traceback.print_exc(file=sys.stdout)
return