Skip to content

Commit f5af3c4

Browse files
Jenkinsopenstack-gerrit
Jenkins
authored andcommitted
Merge "added docs and warnings about using SSL"
2 parents e48d01a + 3053c53 commit f5af3c4

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

doc/source/deployment_guide.rst

+6-2
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,12 @@ bind_port 80 Port for server to bind to
512512
swift_dir /etc/swift Swift configuration directory
513513
workers 1 Number of workers to fork
514514
user swift User to run as
515-
cert_file Path to the ssl .crt
516-
key_file Path to the ssl .key
515+
cert_file Path to the ssl .crt. This
516+
should be enabled for testing
517+
purposes only.
518+
key_file Path to the ssl .key. This
519+
should be enabled for testing
520+
purposes only.
517521
============================ =============== =============================
518522

519523
[proxy-server]

doc/source/howto_installmultinode.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ Configure the Proxy node
109109

110110
.. note::
111111
If you don't create the cert files, Swift silently uses http internally rather than https. This document assumes that you have created
112-
these certs, so if you're following along step-by-step, create them.
112+
these certs, so if you're following along step-by-step, create them. In a
113+
production cluster, you should terminate SSL before the proxy server. SSL
114+
support is provided for testing purposes only.
113115

114116
#. Modify memcached to listen on the default interfaces. Preferably this should be on a local, non-public network. Edit the IP address in /etc/memcached.conf, for example::
115117

etc/proxy-server.conf-sample

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# swift_dir = /etc/swift
66
# workers = 1
77
# user = swift
8+
# Set the following two lines to enable SSL. This is for testing only.
89
# cert_file = /etc/swift/proxy.crt
910
# key_file = /etc/swift/proxy.key
1011
# expiring_objects_container_divisor = 86400

swift/common/wsgi.py

+8
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,13 @@ def get_socket(conf, default_port=8080):
6868
if addr[0] in (socket.AF_INET, socket.AF_INET6)][0]
6969
sock = None
7070
retry_until = time.time() + 30
71+
warn_ssl = False
7172
while not sock and time.time() < retry_until:
7273
try:
7374
sock = listen(bind_addr, backlog=int(conf.get('backlog', 4096)),
7475
family=address_family)
7576
if 'cert_file' in conf:
77+
warn_ssl = True
7678
sock = ssl.wrap_socket(sock, certfile=conf['cert_file'],
7779
keyfile=conf['key_file'])
7880
except socket.error, err:
@@ -86,6 +88,12 @@ def get_socket(conf, default_port=8080):
8688
# in my experience, sockets can hang around forever without keepalive
8789
sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
8890
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPIDLE, 600)
91+
if warn_ssl:
92+
ssl_warning_message = 'WARNING: SSL should only be enabled for ' \
93+
'testing purposes. Use external SSL ' \
94+
'termination for a production deployment.'
95+
get_logger(conf).warning(ssl_warning_message)
96+
print _(ssl_warning_message)
8997
return sock
9098

9199

0 commit comments

Comments
 (0)