diff options
author | petermayo@chromium.org <petermayo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-15 03:02:39 +0000 |
---|---|---|
committer | petermayo@chromium.org <petermayo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-15 03:02:39 +0000 |
commit | 3116ebe19e1ed9c9f71ce87124e029fec2768479 (patch) | |
tree | 6345f2d28c6818b4d9c66fc3d30395bf75262deb /tools/python/google | |
parent | 00df60f5f14b66ef94d6da1914cfc5fbdb704151 (diff) | |
download | chromium_src-3116ebe19e1ed9c9f71ce87124e029fec2768479.zip chromium_src-3116ebe19e1ed9c9f71ce87124e029fec2768479.tar.gz chromium_src-3116ebe19e1ed9c9f71ce87124e029fec2768479.tar.bz2 |
Factor out some SSL specific configs, and add another reference to /var/run to
override as well.
TEST=not yet
BUG=none
Review URL: http://codereview.chromium.org/5591007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69222 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/python/google')
-rw-r--r-- | tools/python/google/platform_utils_linux.py | 14 | ||||
-rw-r--r-- | tools/python/google/platform_utils_mac.py | 11 |
2 files changed, 21 insertions, 4 deletions
diff --git a/tools/python/google/platform_utils_linux.py b/tools/python/google/platform_utils_linux.py index db47dc2..db4eb50 100644 --- a/tools/python/google/platform_utils_linux.py +++ b/tools/python/google/platform_utils_linux.py @@ -81,6 +81,8 @@ class PlatformUtility(object): cert_file = google.path_utils.FindUpward(self._base_dir, 'tools', 'python', 'google', 'httpd_config', 'httpd2.pem') + ssl_enabled = os.path.exists('/etc/apache2/mods-enabled/ssl.conf') + httpd_vars = { "httpd_executable_path": os.path.join(self._UnixRoot(), "usr", "sbin", exe_name), @@ -91,6 +93,8 @@ class PlatformUtility(object): "mime_types_path": mime_types_path, "output_dir": output_dir, "ssl_mutex": "file:"+os.path.join(output_dir, "ssl_mutex"), + "ssl_session_cache": + "shmcb:" + os.path.join(output_dir, "ssl_scache") + "(512000)", "user": os.environ.get("USER", "#%d" % os.geteuid()), "lock_file": os.path.join(output_dir, "accept.lock"), } @@ -112,12 +116,18 @@ class PlatformUtility(object): ' -C \'User "%(user)s"\'' ' -C \'ServerRoot "%(server_root)s"\'' ' -c \'LockFile "%(lock_file)s"\'' - ' -c \'SSLCertificateFile "%(ssl_certificate_file)s"\'' - ' -c \'SSLMutex "%(ssl_mutex)s"\'' ) if document_root: httpd_cmd_string += ' -C \'DocumentRoot "%(document_root)s"\'' + + if ssl_enabled: + httpd_cmd_string += ( + ' -c \'SSLCertificateFile "%(ssl_certificate_file)s"\'' + ' -c \'SSLMutex "%(ssl_mutex)s"\'' + ' -c \'SSLSessionCache "%(ssl_session_cache)s"\'' + ) + # Save a copy of httpd_cmd_string to use for stopping httpd self._httpd_cmd_string = httpd_cmd_string % httpd_vars diff --git a/tools/python/google/platform_utils_mac.py b/tools/python/google/platform_utils_mac.py index 6603a41..c0a13e8 100644 --- a/tools/python/google/platform_utils_mac.py +++ b/tools/python/google/platform_utils_mac.py @@ -81,6 +81,8 @@ class PlatformUtility(object): cert_file = google.path_utils.FindUpward(self._base_dir, 'tools', 'python', 'google', 'httpd_config', 'httpd2.pem') + ssl_enabled = os.path.exists('/etc/apache2/mods-enabled/ssl.conf') + httpd_vars = { "httpd_executable_path": os.path.join(self._UnixRoot(), "usr", "sbin", exe_name), @@ -112,12 +114,17 @@ class PlatformUtility(object): ' -C \'User "%(user)s"\'' ' -C \'ServerRoot "%(server_root)s"\'' ' -c \'LockFile "%(lock_file)s"\'' - ' -c \'SSLCertificateFile "%(ssl_certificate_file)s"\'' - ' -c \'SSLMutex "%(ssl_mutex)s"\'' ) if document_root: httpd_cmd_string += ' -C \'DocumentRoot "%(document_root)s"\'' + + if ssl_enabled: + httpd_cmd_string += ( + ' -c \'SSLCertificateFile "%(ssl_certificate_file)s"\'' + ' -c \'SSLMutex "%(ssl_mutex)s"\'' + ) + # Save a copy of httpd_cmd_string to use for stopping httpd self._httpd_cmd_string = httpd_cmd_string % httpd_vars |