Hello there, I was wondering if anyone here could help me. I
am trying to write an asynchronous security proxy application; it
does an SSL_accept fine when I use it with the openssl client
but when I try to run it through netscape it fails and
exits. ERR_print_errors_fp(stderr) gives me:
14642:error:1407609B::lib ( 20 ) :SSL23_GET_CLIENT_HELLO:https proxy request:/us
r/src/lib/libssl/obj/ssl/../src/ssl/s23_srvr.c:390:
which seems to imply that it's sending an http request instead of the
appropriate client hello stuff.
This is the first thing I have tried to program with openssl so I'm
hoping it's something simple that I just don't know about. Any help
would be greatly appreciated.
Thanks,
Rachel
PS Some code if it would be useful
void accept_cb(int s, SSL_CTX* ctx, struct sockaddr *addr, socklen_t *addrlenp)
{
SSL* ssl;
BIO* sbio;
int err;
int cs;
ncon++;
printf("accept %d\n", ncon);
cs = accept(s, addr, addrlenp);
printf("foooo\n");
//make_async(cs);
if (cs<0)
{
printf("bad socket");
perror("accept");
exit(1);
}
printf("socket appears to work\n");
ssl = SSL_new(ctx);
sbio=BIO_new_socket(cs,BIO_NOCLOSE);
SSL_set_bio(ssl,sbio,sbio);
printf("new ssl context created\n");
CHK_NULL(ssl);
printf("null check done\n");
SSL_set_fd(ssl, cs);
SSL_set_options(ssl,SSL_OP_ALL);
err=SSL_accept(ssl);
CHK_SSL(err);
printf("all the ssl stuff was done\n");
ref<Thunk> th = new refcounted<Thunk>();
th->_id = ncon;
th->_s = cs;
th->ssl=ssl;
th->ctx=ctx;
fdcb(th->_s, selread, wrap(&readfromclient_cb, th));
}
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]