On 18-10-12 19:43, Mayank Kumar (mayankum) wrote: > Resending since I didn't get any response. Is there a way to extract the > ssl context for the https connection initiated so that we could use > SSL_read on the socket handle extracted from the curl handle. > > From: Mayank Kumar (mayankum) Sent: Tuesday, October 02, 2012 4:08 PM To: > [email protected] Subject: How can i get the SSL context from a > curl handle > > Here is what I am trying to do :- > > > 1. Initiate a https connection using curl_easy_perform > > 2. Extract the socket from curl handle > > 3. Extract the ssl context from the curl handle and then use > SSL_read to read the data from the socket since the other side will send > encrypted data written using SSL_write. > > > Not sure how to get 3 working. > > Thanks Mayank
I'm inclined to simply answer: This is already taken care of by libcurl. A libcurl build against OpenSSL would even use SSL_read() to get a hold of the data. Perhaps this libcurl example might be helpful: http://curl.haxx.se/libcurl/c/getinmemory.html The magic is that libcurl will provide you the decrypted data through the CURLOPT_WRITEFUNCTION callback, for example. No need to bother with SSL_read() on the libcurl end. does this help? ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.html
