Ignore:
Timestamp:
27/05/10 14:30:08 (10 years ago)
Author:
pjkersha
Message:
  • Working myproxy-ws-logon.sh MyProxy? logon web service client script.
  • Also integrated with unit test which launches the WSGI app by starting it running over HTTPS with paster in a separate thread and then queries it with the client script.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/MyProxyServerUtils/myproxy/server/test/myproxy_ws.py

    r6893 r6895  
    1717THIS_DIR = path.dirname(__file__) 
    1818INI_FILENAME = 'myproxywsgi.ini' 
    19 INI_FILEPATH = path.join(THIS_DIR, INI_FILENAME)   
    20 SSLCERT_FILEPATH = 'localhost.crt' 
    21 SSLKEY_FILEPATH = 'localhost.key' 
     19INI_FILEPATH = path.join(THIS_DIR, INI_FILENAME)  
     20SSLCERT_FILEPATH = path.join(THIS_DIR, 'localhost.crt') 
     21SSLKEY_FILEPATH = path.join(THIS_DIR, 'localhost.key') 
    2222PORTNUM = 7443 
    23 WITH_SSL = True 
     23WITH_SSL = True # Set to False to run over HTTP 
    2424 
    2525if __name__ == "__main__": 
     26    # Provide a port number as command line argument or accept the default 
     27    # PORTNUM 
    2628    if len(sys.argv) > 1: 
    2729        port = sys.argv[1] 
     
    2931        port = PORTNUM 
    3032         
    31     certFilePath = path.join(THIS_DIR, SSLCERT_FILEPATH) 
    32     priKeyFilePath = path.join(THIS_DIR, SSLKEY_FILEPATH) 
    33      
    3433    if WITH_SSL: 
    3534        ssl_context = SSL.Context(SSL.SSLv23_METHOD) 
    3635        ssl_context.set_options(SSL.OP_NO_SSLv2) 
    3736     
    38         ssl_context.use_privatekey_file(priKeyFilePath) 
    39         ssl_context.use_certificate_file(certFilePath) 
     37        ssl_context.use_privatekey_file(SSLKEY_FILEPATH) 
     38        ssl_context.use_certificate_file(SSLCERT_FILEPATH) 
    4039    else: 
    4140        ssl_context = None 
Note: See TracChangeset for help on using the changeset viewer.