def create_ssl_cert():
if PY3:
from subprocess import DEVNULL
else:
DEVNULL = open(os.devnull, 'wb')
try:
ssl_exec_list = ['openssl', 'req', '-new', '-x509', '-keyout', ssl_cert_path,
'-out', ssl_cert_path, '-days', '365', '-nodes',
'-subj', '/CN=www.talhasch.com/O=Talhasch Inc./C=TR']
call(ssl_exec_list, stdout=DEVNULL, stderr=DEVNULL)
except OpenSslExecutableNotFoundError:
logging.error('openssl executable not found!')
exit(1)
logging.info('Self signed ssl certificate created at {}'.format(ssl_cert_path))
评论列表
文章目录