Skip to content

Commit

Permalink
Fix --selfsign, suppress shutdown() noise in TLS-enabled httpd
Browse files Browse the repository at this point in the history
  • Loading branch information
Bjarni R. Einarsson committed Mar 13, 2016
1 parent af30ef6 commit cf3be0e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pagekite/httpd.py
Original file line number Diff line number Diff line change
Expand Up @@ -966,12 +966,12 @@ def __init__(self, sspec, pkite, conns,

if ssl_pem_filename:
ctx = socks.SSL.Context(socks.SSL.TLSv1_METHOD)
ctx.set_ciphers('HIGH:-aNULL:-eNULL:-PSK:RC4-SHA:RC4-MD5')
ctx.set_cipher_list('HIGH:-aNULL:-eNULL:-PSK:RC4-SHA:RC4-MD5')
ctx.use_privatekey_file (ssl_pem_filename)
ctx.use_certificate_chain_file(ssl_pem_filename)
self.socket = socks.SSL_Connect(ctx, socket.socket(self.address_family,
self.socket_type),
server_side=True)
server_side=True)
self.server_bind()
self.server_activate()
self.enable_ssl = True
Expand Down Expand Up @@ -1005,4 +1005,8 @@ def finish_request(self, request, client_address):
except (socket.error, socks.SSL.ZeroReturnError, socks.SSL.Error):
pass


def shutdown_request(self, *args):
try:
return SimpleXMLRPCServer.shutdown_request(self, *args)
except TypeError:
return SimpleXMLRPCServer.close_request(self, *args)

0 comments on commit cf3be0e

Please sign in to comment.