Rob Crittenden wrote:
> In an SSL client I want to force the SSL handshake to take place instead 
> of passively waiting for it to happen during the first write.
> 
> Right after I connect to the server I'm currently doing this:
> 
>    SSL_ResetHandshake(ssl, /* asServer */ PR_FALSE);
>    do {
>      SSL_ForceHandshake(ssl);
>      PR_Recv (ssl, handshake, 1, PR_MSG_PEEK, 100);
>      err = PR_GetError();
>    } while (err != PR_END_OF_FILE_ERROR && handshake_done == 0);
> 

This code may also run into bug 273861.
https://bugzilla.mozilla.org/show_bug.cgi?id=273861
Be sure there's no unread data on the sslsocket before calling ForceHandshake.

-- 
Nelson B
_______________________________________________
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to