I have a tcp server which detects an incoming SSL connection (see here) and then does the following:
BIO* initialize(SSL_CTX *context, int socket){
BIO *bio = NULL;
SSL *ssl = SSL_new(context);
SSL_set_fd(ssl, socket);
if (SSL_accept(ssl) == -1){
return NULL; //error
}
//what do I do here??
bio = BIO_new_ssl(context, 1); //this seems wrong...
return bio;
}
I dont know how to create the BIO object and the documentation is really confusing. Any help is appreciated. Thanks!
This is an excerpt of an old student project of mine (circa 2006).
I hope it sheds some light on the question.
I do not use BIO_new_ssl() but SSL_set_bio().