Changes between Version 2 and Version 3 of ndg_httpsclient


Ignore:
Timestamp:
17/01/12 14:54:03 (6 years ago)
Author:
pjkersha
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ndg_httpsclient

    v2 v3  
    1818  * Make context verify the peer: 
    1919{{{ 
     20>>> from OpenSSL import SSL 
    2021>>> ctx = SSL.Context(SSL.SSLv3_METHOD) 
    2122>>> verify_callback = lambda conn, x509, errnum, errdepth, preverify_ok: preverify_ok  
    2223>>> ctx.set_verify(SSL.VERIFY_PEER, verify_callback) 
    2324>>> ctx.set_verify_depth(9) 
    24 >>> ctx.load_verify_locations(None, Constants.CACERT_DIR) 
     25>>> ctx.load_verify_locations(None, '/my/cacerts') 
    2526}}} 
    2627  * Make a new connection with this context:   
     28{{{ 
     29>>> from ndg.httpsclient.https import HTTPSConnection 
    2730>>> conn = HTTPSConnection('localhost', port=443, ssl_context=ctx) 
    2831>>> conn.connect()