diff options
author | Brad Warren <bmw@users.noreply.github.com> | 2017-09-20 20:35:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-20 20:35:32 +0300 |
commit | 7f5f6471fea939c70294c2f31875d90320482861 (patch) | |
tree | 58f86ec7e767d01bc97eda1d2a464e35be6ef158 | |
parent | 49697b99d0b77659d3980601a39cdded0073b473 (diff) |
fix #5111 AttributeError occured with >=pyOpenSSL-17.2.0 (#5112) (#5122)
(cherry picked from commit f6be07da74c664b57ac8c053585f919c79f9af44)
-rw-r--r-- | acme/acme/crypto_util.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/acme/acme/crypto_util.py b/acme/acme/crypto_util.py index de15284c0..b8fba0348 100644 --- a/acme/acme/crypto_util.py +++ b/acme/acme/crypto_util.py @@ -2,6 +2,7 @@ import binascii import contextlib import logging +import os import re import socket import sys @@ -243,7 +244,7 @@ def gen_ss_cert(key, domains, not_before=None, """ assert domains, "Must provide one or more hostnames for the cert." cert = OpenSSL.crypto.X509() - cert.set_serial_number(int(binascii.hexlify(OpenSSL.rand.bytes(16)), 16)) + cert.set_serial_number(int(binascii.hexlify(os.urandom(16)), 16)) cert.set_version(2) extensions = [ |