Answer the question
In order to leave comments, you need to log in
OpenSSL client via prosky. Is there an example?
I have already climbed "the whole Internet" ™ - for the life of me I can not find an example of an https client on a "pure" OpenSSL lib on c (++) through an http (s?) proxy.
As I understand it, first connect goes to the proxy itself (without SSL?), then "CONNECT realhost.com:443" is sent to it and already to it with SSL. So? Are there http proxies that can encrypt traffic to them? Or is it not needed?
Because:
> curl https://ipinfo.io/ -v -x http://54.37.130.2:3128
<показывает ip>
> curl https://ipinfo.io/ -v -x https://54.37.130.2:3128
* OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection
SSL_library_init();
OPENSSL_init_ssl(0, NULL);
OpenSSL_add_all_algorithms();
SSL_load_error_strings();
ERR_load_crypto_strings();
ERR_load_BIO_strings();
SSL_CTX* ctx = SSL_CTX_new(SSLv23_method());
SSL_CTX_set_options(ctx, SSL_OP_ALL);
SSL* ssl;
BIO* bio = BIO_new_ssl_connect(ctx);
BIO_get_ssl(bio, &ssl);
SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY);
BIO_set_conn_hostname(bio, proxy_ip);
BIO_set_conn_port(bio, proxy_port);
SSL_set_tlsext_host_name(ssl, (void*)proxy_ip)); // надо ли?
BIO_do_connect(bio); // <--------------- error 0 ибо прокси, как я понимаю, ждёт plain, а не ssl
char buffer = "CONNECT realhost.com:443 HTTP/1.1\r\nProxy-Connection: Keep-Alive\r\n\r\n");
BIO_write(bio, buffer, strlen(buffer));
// <--------- что дальше?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question