summaryrefslogtreecommitdiffstats
path: root/ipa-server/ipaserver/httpinstance.py
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2007-12-11 14:19:10 -0500
committerSimo Sorce <ssorce@redhat.com>2007-12-11 14:19:10 -0500
commit5215b21ea404f2370bfdd4a2e452577e065a718c (patch)
tree8893bdeebf94979c66febd0d1f84fde9d311ed4e /ipa-server/ipaserver/httpinstance.py
parent4f0b2154146cc3ed3b32b34713089323d96c1c74 (diff)
parent01131e2a37a9aec197b4e286e0559165d403fe73 (diff)
downloadfreeipa.git-5215b21ea404f2370bfdd4a2e452577e065a718c.tar.gz
freeipa.git-5215b21ea404f2370bfdd4a2e452577e065a718c.tar.xz
freeipa.git-5215b21ea404f2370bfdd4a2e452577e065a718c.zip
merge with upstream
Diffstat (limited to 'ipa-server/ipaserver/httpinstance.py')
-rw-r--r--ipa-server/ipaserver/httpinstance.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/ipa-server/ipaserver/httpinstance.py b/ipa-server/ipaserver/httpinstance.py
index 30103513..1799cca0 100644
--- a/ipa-server/ipaserver/httpinstance.py
+++ b/ipa-server/ipaserver/httpinstance.py
@@ -27,11 +27,14 @@ import sys
import time
import service
+import certs
+import dsinstance
from ipa.ipautil import *
HTTPD_DIR = "/etc/httpd"
SSL_CONF = HTTPD_DIR + "/conf.d/ssl.conf"
NSS_CONF = HTTPD_DIR + "/conf.d/nss.conf"
+NSS_DIR = HTTPD_DIR + "/alias"
selinux_warning = """WARNING: could not set selinux boolean httpd_can_network_connect to true.
The web interface may not function correctly until this boolean is
@@ -64,12 +67,13 @@ class HTTPInstance(service.Service):
self.fqdn = fqdn
self.realm = realm
- self.start_creation(6, "Configuring the web interface")
+ self.start_creation(7, "Configuring the web interface")
self.__disable_mod_ssl()
self.__set_mod_nss_port()
self.__configure_http()
self.__create_http_keytab()
+ self.__setup_ssl()
self.step("restarting httpd")
self.restart()
@@ -143,3 +147,12 @@ class HTTPInstance(service.Service):
self.step("Setting mod_nss port to 443")
if update_file(NSS_CONF, '8443', '443') != 0:
print "Updating %s failed." % NSS_CONF
+
+ def __setup_ssl(self):
+ self.step("Setting up ssl")
+ ds_ca = certs.CertDB(dsinstance.config_dirname(self.realm))
+ ca = certs.CertDB(NSS_DIR)
+ ds_ca.cur_serial = 2000
+ ca.create_from_cacert(ds_ca.cacert_fname)
+ ca.create_server_cert("Server-Cert", "cn=%s,ou=Apache Web Server" % self.fqdn, ds_ca)
+