def retrieveCAChain(): if not os.path.isfile(conf.certsDir + "/ca.crt"): try: rawCrt = certUtils.retrieveCAChain(conf.EJBCA_API_URL, conf.CAName) certUtils.saveCRT(conf.certsDir + "/ca.crt", rawCrt) print("CA certificates retrieved") except KeyError: print "Invalid answer returned from EJBCA." exit(-1)
def retrieveCAChain(): try: rawCrt = certUtils.retrieveCAChain(conf.ejbcaApiUrl) certUtils.saveCRT(conf.certsDir + "/ca.crt", rawCrt) print("CA certificates retrieved") except certUtils.x509IdentityMgmtException as err: print("Cant retrieve CA Chain. Error from x509-identity-mgmt: " + err.message) exit(-1) except KeyError: print("Invalid answer returned from EJBCA.") exit(-1)
def retrieveCAChain(ejbcaHost, caName, overwrite): filename = conf.certsDir + "/" + caName + ".crt" if not os.path.isfile(filename) or overwrite: try: rawCrt = certUtils.retrieveCAChain(ejbcaHost, caName) certUtils.saveCRT(filename, rawCrt) print("CA certificates retrieved") except KeyError: print("Invalid answer returned from EJBCA.") exit(-1) else: print("CA Certificate file already exists at " + filename + ". Skiping.")
def retrieveCAChain(ejbcaHost, caName, overwrite): filename = conf.certsDir + "/" + caName + ".crt" if not os.path.isfile(filename) or overwrite: try: rawCrt = certUtils.retrieveCAChain(ejbcaHost, caName) certUtils.saveCRT(filename, rawCrt) print("CA certificates retrieved") except KeyError: print("Invalid answer returned from EJBCA.") exit(-1) except requests.exceptions.HTTPError as err: print("Can't retrieve CA chain certificate." " EJBCA-REST return code: " + str(err.response.status_code)) print(str(err.response.text)) helperErrorDesc(err.response.status_code) exit(-1) else: print("CA Certificate file already exists at " + filename + ". Skiping.")