Query Regarding usage of SSL_Connect()

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Query Regarding usage of SSL_Connect()

Amit Kumar-38
Hi team,
   I am using SSL_Connect() in one of my projects and this SSL_connect is returning a value of -1.

   With SSL_get_error() i can see it is SSL_ERROR_WANT_READ ?
 
   Now i am not understanding why this can come and if this is there then should i call SSL_Connect again.
 
   I am really new to OpenSSL API's and learning it. Please consider me as a beginner while replying.

  Any help will be greatly appreciated.

--
Amit Kumar
Engineer
Reply | Threaded
Open this post in threaded view
|

Re: Query Regarding usage of SSL_Connect()

Gayathri Sundar-3
Please dont expect much response to this question. Going thro the man pages of openssl will have all the necessary answers you are expecting. Do you homework before coding.

Thanks
--Gayathri

On Thu, Jul 14, 2011 at 8:17 AM, Amit Kumar <[hidden email]> wrote:
Hi team,
   I am using SSL_Connect() in one of my projects and this SSL_connect is returning a value of -1.

   With SSL_get_error() i can see it is SSL_ERROR_WANT_READ ?
 
   Now i am not understanding why this can come and if this is there then should i call SSL_Connect again.
 
   I am really new to OpenSSL API's and learning it. Please consider me as a beginner while replying.

  Any help will be greatly appreciated.

--
Amit Kumar
Engineer

Reply | Threaded
Open this post in threaded view
|

FYI openssl documentation

Kenneth Goldman
In reply to this post by Amit Kumar-38
FYI:  I've been using
        http://www.openssl.org/docs/crypto/crypto.html
as a starting point for openssl man pages.

Today, I stumbled upon
        http://www.openssl.org/docs/crypto/
which is much more complete.

Is there someone I should email to request an update to the publically visible page?  Someone went through the trouble to write and upload the man pages.  It's a shame to hide them.

--
Ken Goldman   [hidden email]  
914-784-7646 (863-7646)


Reply | Threaded
Open this post in threaded view
|

Fwd: Query Regarding usage of SSL_Connect()

Sushil Singh-2
In reply to this post by Amit Kumar-38
Hi Amit
I believe you are using non-blocking call. This kind of error will come in the situatation when the SSL is still waiting for data to be available to be read. Before that it can't start processing the data. Pls send me the code snippets where it is failing. I can try to help you in this.
 
If it is in non-blocking mode, then you put the SSL_connect in do while and continue this till SSL_pending is zero bytes or any other error comes. Whichever is earlier.
 
This is based on my assumptions. I can provide you help only when you send your code.
 
Take care.
Sushil 
 
 
 


 
On Thu, Jul 14, 2011 at 6:47 PM, Amit Kumar <[hidden email]> wrote:
Hi team,
   I am using SSL_Connect() in one of my projects and this SSL_connect is returning a value of -1.

   With SSL_get_error() i can see it is SSL_ERROR_WANT_READ ?
 
   Now i am not understanding why this can come and if this is there then should i call SSL_Connect again.
 
   I am really new to OpenSSL API's and learning it. Please consider me as a beginner while replying.

  Any help will be greatly appreciated.

--
Amit Kumar
Engineer

Reply | Threaded
Open this post in threaded view
|

Re: Query Regarding usage of SSL_Connect()

JoelKatz
In reply to this post by Amit Kumar-38
On 7/14/2011 6:17 AM, Amit Kumar wrote:

> Hi team,
>     I am using SSL_Connect() in one of my projects and this SSL_connect
> is returning a value of -1.
>
>     With SSL_get_error() i can see it is *SSL_ERROR_WANT_READ ?*
> *
> *
> *   Now i am not understanding why this can come and if this is there
> then should i call SSL_Connect again.
> *
>     I am really new to OpenSSL API's and learning it. Please consider me
> as a beginner while replying.
>
>    Any help will be greatly appreciated.

It means SSL_Connect has made as much forward progress as it can right
now and will be able to make further forward progress when it reads some
data from the server. Since you asked it not to block, it is not blocking.

DS


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]