Back to index

python3.2  3.2.2
Classes | Functions | Variables
test.ssl_servers Namespace Reference

Classes

class  HTTPSServer
class  RootedHTTPRequestHandler
class  StatsRequestHandler
class  HTTPSServerThread

Functions

def make_https_server

Variables

tuple threading = support.import_module("threading")
tuple here = os.path.dirname(__file__)
 HOST = support.HOST
tuple CERTFILE = os.path.join(here, 'keycert.pem')
tuple parser
string help = 'port to listen on (default: %(default)s)'
string action = 'store_false'
tuple args = parser.parse_args()
 handler_class = StatsRequestHandler
tuple context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
tuple server = HTTPSServer(("", args.port), handler_class, context)

Function Documentation

def test.ssl_servers.make_https_server (   case,
  certfile = CERTFILE,
  host = HOST,
  handler_class = None 
)

Definition at line 145 of file ssl_servers.py.

00145 
00146 def make_https_server(case, certfile=CERTFILE, host=HOST, handler_class=None):
00147     # we assume the certfile contains both private key and certificate
00148     context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
00149     context.load_cert_chain(certfile)
00150     server = HTTPSServerThread(context, host, handler_class)
00151     flag = threading.Event()
00152     server.start(flag)
00153     flag.wait()
00154     def cleanup():
00155         if support.verbose:
00156             sys.stdout.write('stopping HTTPS server\n')
00157         server.stop()
00158         if support.verbose:
00159             sys.stdout.write('joining HTTPS thread\n')
00160         server.join()
00161     case.addCleanup(cleanup)
00162     return server
00163 

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 172 of file ssl_servers.py.

tuple test.ssl_servers.args = parser.parse_args()

Definition at line 175 of file ssl_servers.py.

tuple test.ssl_servers.CERTFILE = os.path.join(here, 'keycert.pem')

Definition at line 17 of file ssl_servers.py.

tuple test.ssl_servers.context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)

Definition at line 183 of file ssl_servers.py.

Definition at line 179 of file ssl_servers.py.

string test.ssl_servers.help = 'port to listen on (default: %(default)s)'

Definition at line 170 of file ssl_servers.py.

tuple test.ssl_servers.here = os.path.dirname(__file__)

Definition at line 14 of file ssl_servers.py.

Definition at line 16 of file ssl_servers.py.

Initial value:
00001 argparse.ArgumentParser(
00002         description='Run a test HTTPS server. '
00003                     'By default, the current directory is served.')

Definition at line 166 of file ssl_servers.py.

Definition at line 186 of file ssl_servers.py.

Definition at line 12 of file ssl_servers.py.