Commit bfb35532 authored by Julien Muchembled's avatar Julien Muchembled

fixup! Require private key to have a matching certificate

This fixes the following error on Python 3:

  TypeError: startswith first arg must be bytes or a tuple of bytes, not str
parent abaa96e2
...@@ -16,7 +16,7 @@ def dump_publickey(type, pkey): ...@@ -16,7 +16,7 @@ def dump_publickey(type, pkey):
assert type == FILETYPE_PEM, type assert type == FILETYPE_PEM, type
pkey.seek(0, 0) pkey.seek(0, 0)
r = pkey.read() r = pkey.read()
if not r.startswith('-----BEGIN PUBLIC KEY-----'): if not r.startswith(b'-----BEGIN PUBLIC KEY-----'):
p = Popen(("openssl", "rsa", "-in", pkey.name, "-pubout"), p = Popen(("openssl", "rsa", "-in", pkey.name, "-pubout"),
stdout=PIPE, stderr=PIPE) stdout=PIPE, stderr=PIPE)
r, err = p.communicate() r, err = p.communicate()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment