How can I add ability for OpenSSL client to connect to OpenSSL server via proxy?
Printable View
How can I add ability for OpenSSL client to connect to OpenSSL server via proxy?
https://www.openssl.org/docs/manmast.../s_client.html
Look at the openssl(.exe) code and see what it does with the -proxy option.
gg
Here is my connection code
Where do I have to use this option?Code:int openConnection(const char *hostName, int port)
{
struct hostent *host;
struct sockaddr_in addr;
if ((host = gethostbyname(hostName)) == nullptr) {
perror(hostName);
abort();
}
int sd = socket(PF_INET, SOCK_STREAM, 0);
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_port = htons(port);
addr.sin_addr.s_addr = *(long*)(host->h_addr);
if (connect(sd, (struct sockaddr *)&addr, sizeof(addr)) != 0) {
closesocket(sd);
perror(hostName);
abort();
}
return sd;
}
Look at the openssl(.exe) code and see what it does with the -proxy option.
gg