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
  • Loading branch information
darkcircle authored and sydneyli committed Jun 15, 2018
1 parent 9caf995 commit fce4992
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 fce4992

Please sign in to comment.