Hi
i use the follow to write to ssl
int hb_inetSSLWrite( SSL* pSSL, int iSock,int iTimeout char * msg, int
length, int* iRet)
{
int ret;
int sslerr;
int r;
fd_set fd_r, fd_w;
struct timeval tv;
do
{
ret = SSL_write(pSSL, msg, length);
sslerr = SSL_get_error(pSSL, ret);
if ( ret > 0)
{
r = 1;
*iRet = 0;
break;
}
*iRet = sslerr;
FD_ZERO( &fd_r );
FD_ZERO( &fd_w );
if( iTimeout > 0 )
{
tv.tv_sec = iTimeout / 1000;
tv.tv_usec = ( iTimeout % 1000 ) * 1000;
}
switch (sslerr)
{
case SSL_ERROR_WANT_READ:
FD_SET(iSock,&fd_r);
break;
case SSL_ERROR_WANT_WRITE:
FD_SET(iSock,&fd_w);
break;
default:
return -1;
}
if( iTimeout > 0 )
r = select(iSock+1,&fd_r,&fd_w,NULL,&tv);
else
r = select(iSock+1,&fd_r,&fd_w,NULL,NULL);
} while ( ret == -1 && r != 0 );
if ( r == 0)
return -1;
return ret;
}
> Hi,
>
> I got some weird error. help needed urgent.
>
> SSL_write() is returned with error "SSL3_WRITE_PENDING:bad write retry".
> I have tried with flags "PARTIAL_WRITE" and "AUTO_RETRY" and "MOVING
> BUFFER".
> Still i am facing this problem. Any temporary workaround will also be
> appreciated.
>
> Thanks & Regards,
> Sandeep
>
> Please do not print this email unless it is absolutely necessary.
>
> The information contained in this electronic message and any attachments
> to this message are intended for the exclusive use of the addressee(s) and
> may contain proprietary, confidential or privileged information. If you
> are not the intended recipient, you should not disseminate, distribute or
> copy this e-mail. Please notify the sender immediately and destroy all
> copies of this message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient
> should check this email and any attachments for the presence of viruses.
> The company accepts no liability for any damage caused by any virus
> transmitted by this email.
>
> www.wipro.com
>
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [email protected]
Automated List Manager [email protected]