On Sat, Mar 03, 2001 at 05:57:49PM +0200, Teemu Piiroinen wrote:
> I have tried to use BIO pair and for some reason it doesn't
> seem to work right. So, here is the code if someone could
> tell me what's going wrong.
>
> I have tried to make it work without SSL_set_fd and SSL_accept, but it won't work.
>
>
> ssl = SSL_new (ctx);
>
> SSL_set_fd (ssl, sd); // Do I need this line at all? sd =
>socket
Now, the SSL will not talk directly to the socket!
> BIO *internalbio = new BIO;
> BIO *networkbio = new BIO;
What is "new BIO"?
> BIO_new_bio_pair(&internalbio, 1000, &networkbio, 1000);
>
> SSL_set_bio(ssl, internalbio, internalbio);
So far, so good.
>
> err = SSL_accept (ssl); // Must I make SSL connection startup
>manually?
At this point you are losing the track. The SSL_accept() call will talk to
internalbio and your application has to handle the data transfer from/to
the network connection for it until it has succeeded.
My Postfix/TLS patchkit (available from my homepage) uses BIO pairs.
The ssltest program in the test/ subdirectory of openssl uses BIO pairs.
Please check these examples out.
Best regards,
Lutz
--
Lutz Jaenicke [EMAIL PROTECTED]
BTU Cottbus http://www.aet.TU-Cottbus.DE/personen/jaenicke/
Lehrstuhl Allgemeine Elektrotechnik Tel. +49 355 69-4129
Universitaetsplatz 3-4, D-03044 Cottbus Fax. +49 355 69-4153
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]