':param host: The hostname used to generate the certificate
:return: None, we write the cert and key to files'

def generate(self, host=None):

    if (host is None):
        host = socket.gethostname()
    key = crypto.PKey()
    key.generate_key(crypto.TYPE_RSA, 2048)
    cert = crypto.X509()
    cert.get_subject().C = 'US'
    cert.get_subject().ST = 'CA'
    cert.get_subject().L = 'w3af.org'
    cert.get_subject().O = 'w3af.org'
    cert.get_subject().OU = 'w3af.org'
    cert.get_subject().CN = host
    cert.set_serial_number(111111111111111111111111111L)
    cert.gmtime_adj_notBefore(0)
    cert.gmtime_adj_notAfter(((((10 * 365) * 24) * 60) * 60))
    cert.set_issuer(cert.get_subject())
    cert.set_pubkey(key)
    cert.sign(key, 'sha256')
    with open(self.cert_path, 'w') as f:
        f.write(crypto.dump_certificate(crypto.FILETYPE_PEM, cert))
    with open(self.key_path, 'w') as f:
        f.write(crypto.dump_privatekey(crypto.FILETYPE_PEM, key))
