I have solved my problem.

The problem in my case was a server one. I use a non-blocking socket for the
server to receive information from the clients, so the server performs a
select with a timeout of 1 second to read information. It turns out that
when they are network issues, 1 second is not enough and the select times
out with a 0 return value, so the server was assuming that the client is
gone and closes the connection....

Now, when the select times out I check the errno and if it is EAGAIN, I try
select again... This solved the problem and all clients now are handled
correctly...

What confused me is the man select documentation which states that select
sets errno only if the return value is -1... it seems that even if it
returns 0 errno might be set...

I have seen this problem on Linux and Hp platforms...

Thanks

On Wed, Jan 7, 2009 at 1:44 PM, Andrey Koltsov <kolt...@cyberplat.com>wrote:

> I have the same problem with my client Openssl application. The server side
> is MS IIS. And all other parties use Microsoft based clients and have no
> such problems.
> It seems that a client side is a source of trouble not a server side.
>
> Suggestions from anyone are welcome.
>
>
>  Hi,
>>
>> I have an SSL server handling many clients successfully using
>> openssl-0.9.8e. From time to time however, there are some clients that
>> fail
>> to connect to it. Debugging shows that the problem happens when the client
>> attempts the first SSL_read, which unexpectedly returns 0.
>>
>> Checking then for the SSL error shows that it has the value
>> SSL_ERROR_ZERO_RETURN. According to the SSL documentation this should
>> happen
>> only if the SSL connection has been closed. I do know that my server is
>> not
>> closing it since it is handling many other clients correctly, I also know
>> that for the clients facing this problem, the handshake phase is done
>> correctly.... it is only when the first SSL_read happens that somehow the
>> connection is dropped.... I have no idea why if anyone can help me.
>>
>> Thanks
>>
>>
>
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    openssl-users@openssl.org
> Automated List Manager                           majord...@openssl.org
>

Reply via email to