That was the trick - I was trying to write to a :
BIO* bioMem = BIO_new(BIO_f_buffer());
which doesn't really make sense.
Indeed, this is working:
BIO* bioMem = BIO_new(BIO_s_mem());
SSL_set_bio(m_ssl, NULL, bioMem);
SSL_write(m_ssl, responseData, nRespDataSize);
My SSL object (m_ssl) now has wbio set to the new "memory buffer" BIO (bioMem),
and bioMem shows the correct number of bytes written in num_write.
Good catch - many thanks!
n8
--------------------------------------------------------------------------------
From: [email protected]
[mailto:[email protected]] On Behalf Of Galina Goncharov
Sent: Sunday, March 15, 2009 9:14 PM
To: [email protected]
Subject: Re: TLS, BIOs, SSL_read/write
an other thought - I didn't notice your third SSL_set_bio(m_ssl, NULL,
bioMem); so my suggestion wasn't quite correct.
and its always usfull to get error by calling SSL_get_error() - it can
point to right direction.
and below is from other thread:
=====
The BIO_new_mem_buf creates a read-only buffer.
If you want to write to memory use
bio = BIO_new(BIO_s_mem());
and use BIO_get_mem_ptr to get a pointer to the buffer.
===
Galina
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [email protected]
Automated List Manager [email protected]