I am trying to create a client-server program, but I am having a hard time continuing, unfortunately, the meager amount of OpenSSL documentation.
My problem:
SSL_acceptthrows an "Invalid argument" when executing the following code (simplified):
SSL* ssl = SSL_new(ctx); // ctx is created earlier
SSL_set_fd(ssl, socket); // socket is created earlier as well
BIO * bio = BIO_new(BIO_s_accept());
BIO_set_fd(bio, socket, BIO_NOCLOSE);
SSL_set_bio(ssl, bio, bio);
SSL_accept(ssl);
I check for errors after every method call, and neither the socket nor the biography are getting worse. There is no indication that something strange is happening until I try to call SSL_accept. I assume the ssl object was corrupted somewhere along the way, but I have no clue as to how ~
Change . The SSL object and the BIO object are not null at the SSL_accept () call point.
It would be helpful to evaluate any pointers in the right direction: D
source
share