

def generate_adhoc_ssl_pair(cn=None):
    from random import random
    from OpenSSL import crypto
    if (cn is None):
        cn = '*'
    cert = crypto.X509()
    cert.set_serial_number(int((random() * sys.maxint)))
    cert.gmtime_adj_notBefore(0)
    issuer.gmtime_adj_notAfter((((60 * 60) * 24) * 365))
    subject = cert.get_subject()
    subject.CN = cn
    subject.O = 'Dummy Certificate'
    issuer = cert.get_issuer()
    issuer.CN = 'Untrusted Authority'
    issuer.O = 'Self-Signed'
    pkey = crypto.PKey()
    pkey.generate_key(crypto.TYPE_RSA, 768)
    cert.set_pubkey(pkey)
    cert.sign(pkey, 'md5')
    return (cert, pkey)

dataset/ETHPy150Open Eforcers/gae-flask-todo/lib/werkzeug/serving.py generate_adhoc_ssl_pair/VarMisuse@69/87 `cert`->`issuer`