Beispiel #1
0
    def deleteOneCert(self, filepath):
        certPath = sslutils.deriveFullCertPath(filepath, self.xid)

        # deletee the .crt file
        try:
            ssllog.log.main_logger.debug("Deleting " + certPath + self.crt_fn)
            silentRemove(certPath + self.crt_fn)
        except IOError, e:
            ssllog.log.main_logger.error("Error %d: %s" % (e.args[0],e.args[1]))
            return None
def deleteCertFilesByXID(xid, filepath):
    certPath = sslutils.deriveFullCertPath(filepath, xid)

    # delete the .crt file
    try:
        ssllog.log.main_logger.debug("Deleting " + certPath + "server.crt")
        sslutils.silentRemove(certPath + "server.crt")
    except IOError, e:
        ssllog.log.main_logger.error("Error %d: %s" % (e.args[0],e.args[1]))
        return None
Beispiel #3
0
    def writeOneCert(self, filepath):
        # Make certain we are set up to succeed
        if (not self.cert) or (not self.key):
            return None

        certPath = sslutils.deriveFullCertPath(filepath, self.xid)
        sslutils.make_sure_path_exists(certPath, 0755)

        uid = pwd.getpwnam("nobody").pw_uid
        gid = grp.getgrnam("nobody").gr_gid

        # Write the .crt file
        try:
            ssllog.log.main_logger.debug("Writing " + certPath + self.crt_fn)
            with open(certPath + self.crt_fn, "wt") as fout:
                fout.write(self.cert)
        except IOError, e:
            ssllog.log.main_logger.error("Error %d: %s" % (e.args[0],e.args[1]))
            return None