Skip to content

Commit

Permalink
fix #5111 AttributeError occured with >=pyOpenSSL-17.2.0 (#5112)
Browse files Browse the repository at this point in the history
(cherry picked from commit f6be07d)
  • Loading branch information
darkcircle authored and bmw committed Sep 19, 2017
1 parent 49697b9 commit bb9ab8a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion acme/acme/crypto_util.py
Expand Up @@ -2,6 +2,7 @@
import binascii
import contextlib
import logging
import os
import re
import socket
import sys
Expand Down Expand Up @@ -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 = [
Expand Down

0 comments on commit bb9ab8a

Please sign in to comment.