Vinu wrote, on 2009-05-27 15:26 PDT:
> The server sends the data and then closes the connection(becuase we use HTTP 
> Connection:close and not Keep-Alive).
> 
> But shouldnt PR_Read return the entire data and then only return 0(becuase 
> the connection is closed).
> How can it return 0, before all the data has been returned to the 
> application.
> 
> BTW this same code on Linux and Windows works fine.

The SSL/TLS library in any given version of NSS (such as 3.12.3 say) should
run the same on all platforms, provided that it was built with the same
build options (which are controlled through environment variables).

On some platforms where there may be multiple different copies of NSS, such
as a "system" (OS) copy and an application's local copy, it is not uncommon
for applications to find that they are running with the system's copy, and
not with their own copy.  It is often necessary to set LD_LIBRARY_PATH on
Unix-like systems to ensure that the desired/intended copy of NSS is loaded.

In the SSL/TLS protocols, there are "fatal" errors that may occur.  When a
fatal error occurs, and the application does some operation on the socket
that returns the error code, the application should take note of the error
code and do nothing more with the socket thereafter except close it.
A common application programming mistake is to get an error indication back
from some socket call, ignore the error, and try to read or write on the
socket again.  In such cases, the results of those subsequent operations is
"undefined", and getting an EOF to a read after a fatal error is an entirely
reasonable outcome.

As I wrote before, if all else fails, use ssltap to capture the traffic on
the SSL/TLS connection.  Observe the differences between the output for a
successful connection and a failed one.
-- 
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to