Skip to content

Commit

Permalink
fix certbot#5111 AttributeError occured with >=pyOpenSSL-17.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Seong-ho Cho committed Sep 14, 2017
1 parent 837f691 commit 7f29d60
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

1 comment on commit 7f29d60

@margeson
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've confirmed this works, thank you!

Please sign in to comment.