示例#1
0
def _check_and_generate_gui_certificate(_log):
    """Check validity of GUI certificate and if necessary, (re)generate it."""
    _log.info('checking validity of web UI certificate and regenerating if necessary')

    if helpers.check_self_signed_certificate(constants.WEBUI_PRIVATE_KEY, constants.WEBUI_CERTIFICATE):
        _log.debug('certificate is ok')
    else:
        try:
            helpers.generate_self_signed_certificate(constants.WEBUI_PRIVATE_KEY, constants.WEBUI_CERTIFICATE)
            _log.info('generated a new certificate for the web UI')
        except:
            _log.exception('failed to generate a new certificate for the web UI')
            raise
示例#2
0
 def _regenerate():
     helpers.generate_self_signed_certificate(
         constants.WEBUI_PRIVATE_KEY,
         constants.WEBUI_CERTIFICATE,
         common_name=common_name)
示例#3
0
 def _regenerate():
     helpers.generate_self_signed_certificate(constants.WEBUI_PRIVATE_KEY, constants.WEBUI_CERTIFICATE, common_name=common_name)