Skip to content

Commit

Permalink
more logging info. log info for sign_this_csr()
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Likins committed Mar 18, 2008
1 parent f9375da commit e92972a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions certmaster/certmaster.py
Expand Up @@ -115,6 +115,7 @@ def wait_for_cert(self, csrbuf):
# check for old csr on disk
# if we have it - compare the two - if they are not the same - raise a fault
self.logger.debug("csrfile: %s certfile: %s" % (csrfile, certfile))

if os.path.exists(csrfile):
oldfo = open(csrfile)
oldcsrbuf = oldfo.read()
Expand Down Expand Up @@ -214,14 +215,20 @@ def sign_this_csr(self, csr):

else: # assume we got a bare csr req
csrreq = csr
requesting_host = self._sanitize_cn(csrreq.get_subject().CN)



requesting_host = self._sanitize_cn(csrreq.get_subject().CN)
certfile = '%s/%s.cert' % (self.cfg.certroot, requesting_host)
self.logger.info("Signing for csr %s requested" % certfile)
thiscert = certs.create_slave_certificate(csrreq, self.cakey, self.cacert, self.cfg.cadir)

destfo = open(certfile, 'w')
destfo.write(crypto.dump_certificate(crypto.FILETYPE_PEM, thiscert))
destfo.close()
del destfo


self.logger.info("csr %s signed" % (certfile))
if csr_unlink_file and os.path.exists(csr_unlink_file):
os.unlink(csr_unlink_file)

Expand Down

0 comments on commit e92972a

Please sign in to comment.