Friday, 15 March 2013

c - SSL_accept() Not Working -



c - SSL_accept() Not Working -

i have researched while now, , didn't see exact same problem anywhere. i'm having specific, quite simple problem: whenever echo_server tries run ssl_accept() function, won't block server waiting client connect, function homecoming 0, , if go ssl_get_error(), give me ssl_error_syscall, i'm guessing problem is, quoting manual, "an eof observed violates protocol."

truth have no thought mean, , it's getting frustrating because think i'm missing simple, don't know what.

here's code take function (ssl_ctx initialized , socket opened):

ssl * sslconnection; if((sslconnection = ssl_new(ctx)) == null){ homecoming null; } if(ssl_set_fd(sslconnection, socketd) != 1){ homecoming null; } if(ssl_accept(sslconnection) != 1){ homecoming null; } homecoming sslconnection;

also, i've tried check certificates "openssl verify -verbose -purpose sslserver -cafile 'cacertificate' 'servercertificate'", server certificate ok.

any help welcome, in advance. hope it's stupid , i'm obfuscated can't see it.

whenever echo_server tries run ssl_accept() function, won't block server waiting client connect

ssl_accept not phone call accept you. expects accept has been called.

the right sequence of calls is:

socket bind listen accept ssl_new ssl_set_fd ssl_accept

download openssl sources https://www.openssl.org/source/ , see demos/ssl/serv.cpp.

c sockets ssl openssl eof

No comments:

Post a Comment