mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 02:44:21 +02:00
argh different versions of OpenSSL format this message totally differently!
This commit is contained in:
+1
-1
@@ -18,7 +18,7 @@ def modulusbits(key):
|
|||||||
out, err = subprocess.Popen(["openssl", "rsa", "-pubin", "-text", "-noout"],shell=False,stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE).communicate(key)
|
out, err = subprocess.Popen(["openssl", "rsa", "-pubin", "-text", "-noout"],shell=False,stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE).communicate(key)
|
||||||
if out and not err:
|
if out and not err:
|
||||||
try:
|
try:
|
||||||
size = re.search("Public-Key: \(([0-9]+) bit\)", out).groups()[0]
|
size = re.search("(Public-Key|Modulus):? \(([0-9]+) bit\)", out).groups()[-1]
|
||||||
except:
|
except:
|
||||||
return None
|
return None
|
||||||
return int(size)
|
return int(size)
|
||||||
|
|||||||
Reference in New Issue
Block a user