Try to be cool with pylint (resolving Major issue ?)

This commit is contained in:
Silversthorn 2022-03-15 07:32:08 +00:00
parent 62244637bb
commit 466d71db36

View File

@ -629,8 +629,9 @@ class Helpers:
cert.get_subject().O = "Crafty Controller"
cert.get_subject().OU = "Server Ops"
cert.get_subject().CN = gethostname()
alt_names = ','.join([ 'DNS:%s' % socket.gethostname(), 'DNS:*.%s' % socket.gethostname(), 'DNS:localhost', 'DNS:*.localhost', 'DNS:127.0.0.1']).encode()
cert.add_extensions([
crypto.X509Extension(b'subjectAltName', False, ','.join([ 'DNS:%s' % socket.gethostname(), 'DNS:*.%s' % socket.gethostname(), 'DNS:localhost', 'DNS:*.localhost', 'DNS:127.0.0.1']).encode()),
crypto.X509Extension(b'subjectAltName', False, alt_names),
crypto.X509Extension(b"basicConstraints", True, b"CA:false")]),
cert.set_serial_number(random.randint(1,255))
cert.gmtime_adj_notBefore(0)