title: How can I make my Windows C++/OpenSSL application proxy-aware?
body: <p>I'm working on a desktop C++ application which uses OpenSSL sockets (a raw TLS socket, not HTTPS) to communicate with our server. </p>
  
  <p>One of our clients are required to route their traffic through a proxy. The client  is using ZScaler in <strong>Tunnel with Local Proxy</strong> mode.</p>
  
  <p>In theory, it's possible to reconfigure ZScaler to force our traffic through a proxy chosen by ZScaler. However, I want to investigate solutions where our application uses the Windows OS-level proxy settings rather than relying on ZScaler configuration.</p>
  
  <p>I've read this post:
  <a href="https://stackoverflow.com/questions/3220419/openssl-s-client-using-a-proxy">openssl s_client using a proxy</a></p>
  
  <p>But I'm uncertain whether those answers apply to my situation, because that user didn't mention whether they're using Windows or Linux, and they appear to be talking about an HTTP/HTTPS proxy. Also, that question appears to be asking about the <code>s_client</code> function, rather than simply creating a TLS socket to my server through a "Tunnel with Local Proxy" on Windows. </p>
  
  <p>So, my questions are:<br>
  <strong>Can OpenSSL be used to open an SSL socket to a server through Tunnel with Local Proxy?</strong>  </p>
  
  <p><strong>Can we make an OS call to determine the IP/socket for the Tunnel with Local Proxy configuration?</strong></p>
  
  <p>If this is possible, then I have another question: suppose we have a single proxy at <code>10.100.10.0:5000</code>. </p>
  
  <p><strong>If one user in our client's office opens a socket to our server via their proxy, will a 2nd user be unable to connect from their office because they're bottlenecked at single proxy socket?</strong></p>
  
  <p>Put another way: what is the standard way of implementing proxy-awareness for a Windows application using OpenSSL? </p>
  
  <p><strong>Note:</strong> This question was originally posted to Network Engineering stack exchange, but it was closed because it refers to an issue above OSI layer 4.</p>
  
  <p><strong>Note:</strong> I'm looking for a solution that does <strong>not</strong> require administrator permissions on the user PC. I would prefer for our application to discover and use OS-level proxy settings without making any administrative changes to the machine, i.e. by calling <code>netsh</code>.</p>