From 2e8bae590eae495628ffb709540f7e83eee52ba2 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Wed, 8 Sep 2010 22:11:31 -0400 Subject: Have certmonger track the initial Apache and 389-ds server certs. We don't use certmonger to get certificates during installation because of the chicken-and-egg problem. This means that the IPA web and ldap certs aren't being tracked for renewal. This requires some manual changes to the certmonger request files once tracking has begun because it doesn't store a subject or principal template when a cert is added via start-tracking. This also required some changes to the cert command plugin to allow a host to execute calls against its own service certs. ticket 67 --- ipaserver/install/httpinstance.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'ipaserver/install/httpinstance.py') diff --git a/ipaserver/install/httpinstance.py b/ipaserver/install/httpinstance.py index 48a908f15..af8fdde18 100644 --- a/ipaserver/install/httpinstance.py +++ b/ipaserver/install/httpinstance.py @@ -120,10 +120,9 @@ class HTTPInstance(service.Service): self.print_msg(selinux_warning) def __create_http_keytab(self): - http_principal = "HTTP/" + self.fqdn + "@" + self.realm - installutils.kadmin_addprinc(http_principal) - installutils.create_keytab("/etc/httpd/conf/ipa.keytab", http_principal) - self.move_service(http_principal) + installutils.kadmin_addprinc(self.principal) + installutils.create_keytab("/etc/httpd/conf/ipa.keytab", self.principal) + self.move_service(self.principal) self.add_cert_to_service() pent = pwd.getpwnam("apache") @@ -186,9 +185,11 @@ class HTTPInstance(service.Service): db.create_from_cacert(ca_db.cacert_fname) db.create_password_conf() self.dercert = db.create_server_cert("Server-Cert", self.fqdn, ca_db) + db.track_server_cert("Server-Cert", self.principal, db.passwd_fname) db.create_signing_cert("Signing-Cert", "Object Signing Cert", ca_db) else: self.dercert = db.create_server_cert("Server-Cert", self.fqdn, ca_db) + db.track_server_cert("Server-Cert", self.principal, db.passwd_fname) db.create_signing_cert("Signing-Cert", "Object Signing Cert", ca_db) db.create_password_conf() @@ -251,6 +252,8 @@ class HTTPInstance(service.Service): if not running is None: self.stop() + db = certs.CertDB(NSS_DIR) + db.untrack_server_cert("Server-Cert") if not enabled is None and not enabled: self.chkconfig_off() -- cgit