from OpenSSL import SSL
import time, socket, select
-from func.CommonErrors import canIgnoreSSLError
+from CommonErrors import canIgnoreSSLError
class SSLConnection:
import socket
import exceptions
-#from func.server import codes
import certs
import codes
import utils
from commonconfig import CMConfig
CERTMASTER_LISTEN_PORT = 51235
-CERTMASTER_CONFIG = "/etc/func/certmaster.conf"
+CERTMASTER_CONFIG = "/etc/certmaster/certmaster.conf"
class CertMaster(object):
def __init__(self, conf_file=CERTMASTER_CONFIG):
usename = utils.get_hostname(talk_to_certmaster=False)
mycn = '%s-CA-KEY' % usename
- self.ca_key_file = '%s/funcmaster.key' % self.cfg.cadir
- self.ca_cert_file = '%s/funcmaster.crt' % self.cfg.cadir
+ self.ca_key_file = '%s/certmaster.key' % self.cfg.cadir
+ self.ca_cert_file = '%s/certmaster.crt' % self.cfg.cadir
try:
if not os.path.exists(self.cfg.cadir):
os.makedirs(self.cfg.cadir)
def main(argv):
- cm = CertMaster('/etc/func/certmaster.conf')
+ cm = CertMaster('/etc/certmaster/certmaster.conf')
if "daemon" in argv or "--daemon" in argv:
utils.daemonize("/var/run/certmaster.pid")
csr = certs.make_csr(keypair, dest=csr_file)
except Exception, e:
traceback.print_exc()
- raise codes.FuncException, "Could not create local keypair or csr for session"
+ raise codes.CMException, "Could not create local keypair or csr for session"
result = False
log = logger.Logger().logger
log.debug("submitting CSR to certmaster %s" % master_uri)
result, cert_string, ca_cert_string = submit_csr_to_master(csr_file, master_uri)
except socket.gaierror, e:
- raise codes.FuncException, "Could not locate certmaster at %s" % master_uri
+ raise codes.CMException, "Could not locate certmaster at %s" % master_uri
# logging here would be nice
if not result: