Hello everyone! I'm trying to use openssl lib to access some web and analyse the http json response.the earlier test is ok until it send http request through a http proxy.
i'm not familiar with this lib, which sounds very powerful. and i'm sure that the proxy problem should be considered by the lib dev. there are very limited resource about this lib i could found.Is there any method to set the parameters or some initial functions to do with this?
What I have tried:
this is some simple code which works well without proxy. how to change the code and support the proxy ?
BIO *sbio, *out;
ctx = SSL_CTX_new(SSLv23_client_method());
sbio = BIO_new_ssl_connect(ctx);
fprintf(stderr, "Can't locate SSL pointer\n");
BIO_set_conn_hostname(sbio, "184.108.40.206:443");//some server ip address & port
out = BIO_new_fp(stdout, BIO_NOCLOSE);
if(BIO_do_connect(sbio) <= 0)
fprintf(stderr, "Error connecting to server\n");
printf("SSL connection using %s\n",SSL_get_cipher(ssl));
there are also some messages after the demo execution
Error connecting to server
2601232:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:ssl\record\ssl3_record.c:252:
I've tried to change the paramater of
to the ip of the proxy, still not work.
hope some guys give an example , thanks.