<div dir="ltr">Thanks for the prompt reply <i style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium">Alex !</i><div><font color="#000000" face="Times New Roman" size="3"> </font></div><div><font color="#000000" face="Times New Roman" size="3">I have sent my question to the requests mailing list. I'm using the pythons native ssl library not the pyOpenSSL libary as i can use the ssl's library context in the Adapter. I looked into the requests response object but could'nt find a way to the ciphers from it.</font></div><div><font color="#000000" face="Times New Roman" size="3"><br></font></div><div>I wanted to use the requests package as it provides a higher level library to call into the get,post calls. But i'm not sure how i can interface the OpenSSL Context with the requests, do you know if there is any way i could do that. </div><div><br></div><div>Thanks,</div><div>Konteya.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 13, 2017 at 5:49 PM, Karan karan <span dir="ltr"><<a href="mailto:karan7868@gmail.com" target="_blank">karan7868@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I'm trying to test different cipher and protocols using the request packages, for which i extend the HTTPAdapter. Here are some of the code snippet i have :</div><div><a href="https://lukasa.co.uk/2013/01/Choosing_SSL_Version_In_Requests/" target="_blank">https://lukasa.co.uk/2013/01/<wbr>Choosing_SSL_Version_In_<wbr>Requests/</a><br></div><div><br></div><div>and then wrap it in Session object as follows:</div><div><br></div><div>from ssl import SSLContext</div><div>...</div><div><div>def create_connection(self, sessionreuse=None):</div><div><span style="white-space:pre-wrap">             </span>"""</div><div><span style="white-space:pre-wrap">               </span>Create a http connection over ssl</div><div>    <span style="white-space:pre-wrap">  </span>Arguments: </div><div>    <span style="white-space:pre-wrap">       </span>Returns:   returns the Session object, which can use to be make HTTP call</div><div><br></div><div><span style="white-space:pre-wrap">              </span>"""</div><div><span style="white-space:pre-wrap">               </span>if self._ssl_version and self._cipher:</div><div><span style="white-space:pre-wrap">                   </span>self._context = SSLContext(self._ssl_version)</div><div><span style="white-space:pre-wrap">                    </span>self._context.set_ciphers(<wbr>self._ciphers)</div><div><span style="white-space:pre-wrap">              </span>cipher_adapter = SSLAdapter({'ssl_context': self._context})</div><div><span style="white-space:pre-wrap">              </span>if self._proxy:</div><div><span style="white-space:pre-wrap">                  </span>self._session.update(proxies)</div><div><span style="white-space:pre-wrap">            </span>self._session.mount('https://'<wbr>, cipher_adapter)</div><div><span style="white-space:pre-wrap">               </span>return self._session</div></div><div><br></div><div>Then i use self._session to make get call.</div><div><br></div><div>What i need to find is the :</div><div>- SSL version negotatiated finally </div><div>- Cipher used by the server.</div><div><br></div><div>I would appreciate if some one could help out on it.</div><div><br></div><div>Thanks,</div><div>Karan.</div></div>
</blockquote></div><br></div>