def load_ssl_context(cert_file, pkey_file=None, protocol=None):
 if (protocol is None):
  protocol = ssl.PROTOCOL_SSLv23
 ctx = _SSLContext(protocol)
 ctx.load_cert_chain(cert_file, pkey_file)
 return ctx

def load_ssl_context ( cert_file , pkey_file = None , protocol = None ) : if ( protocol is None ) : protocol = ssl . PROTOCOL_SSLv23 ctx = _SSLContext ( protocol ) ctx . load_cert_chain ( cert_file , pkey_file ) return ctx
loads ssl context from cert/private key files and optional protocol .