<p>Can a (||any) proxy server cache content that is requested by a client over https? As the proxy server can't see the querystring, or the http headers, I reckon they can't.</p>

<p>I'm considering a desktop application, run by a number of people behind their companies proxy. This application may access services across the internet and I'd like to take advantage of the in-built internet caching infrastructure for 'reads'. If the caching proxy servers can't cache SSL delivered content, would simply encrypting the content of a response be a viable option?</p>

<p>I am considering all GET requests that we wish to be cachable be requested over http with the body encrypted using asymmetric encryption, where each client has the decryption key. Anytime we wish to perform a GET that is not cachable, or a POST operation, it will be performed over SSL.</p>

[{'answer_id': 14681, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 6, 'selected': True, 'text': "<p>No, it's not possible to cache https directly. The whole communication between the client and the server is encrypted. A proxy sits between the server and the client, in order to cache it, you need to be able to read it, ie decrypt the encryption.</p>\n\n<p>You can do something to cache it. You basically do the SSL on your proxy, intercepting the SSL sent to the client. Basically the data is encrypted between the client and your proxy, it's decrypted, read and cached, and the data is encrypted and sent on the server. The reply from the server is likewise descrypted, read and encrypted. I'm not sure how you do this on major proxy software (like squid), but it is possible.</p>\n\n<p>The only problem with this approach is that the proxy will have to use a self signed cert to encrypt it to the client. The client will be able to tell that a proxy in the middle has read the data, since the certificate will not be from the original site.</p>\n"}, {'answer_id': 23785, 'author': 'imaginaryboy', 'author_id': 2508, 'author_profile': 'https://Stackoverflow.com/users/2508', 'pm_score': 5, 'selected': False, 'text': '<p>The comment by Rory that the proxy would have to use a self-signed cert if not stricltly true.</p>\n\n<p>The proxy could be implemented to generate a new cert for each new SSL host it is asked to deal with and sign it with a common root cert.  In the OP\'s scenario of a corportate environment the common signing cert can rather easily be installed as a trusted CA on the client machines and they will gladly accept these "faked" SSL certs for the traffic being proxied as there will be no hostname mismatch.</p>\n\n<p>In fact this is exactly how software such as the <a href="http://www.charlesproxy.com/" rel="noreferrer">Charles Web Debugging Proxy</a> allow for inspection of SSL traffic without causing security errors in the browser, etc.</p>\n'}, {'answer_id': 23809, 'author': 'Ari Pernick', 'author_id': 2564, 'author_profile': 'https://Stackoverflow.com/users/2564', 'pm_score': 1, 'selected': False, 'text': "<p>I think you should just use SSL and rely on an HTTP client library that does caching (Ex: WinInet on windows). It's hard to imagine that the benefits of enterprise wide caching is worth the pain of writing a custom security encryption scheme or certificate fun on the proxy. Worse, on the encryption scheme you mention, doing asymmetric ciphers on the entity body sounds like a huge perf hit on the server side of your application; there is a reason that SSL uses symmetric ciphers for the actual payload of the connection.</p>\n"}, {'answer_id': 2861265, 'author': 'Jesse Hallett', 'author_id': 103017, 'author_profile': 'https://Stackoverflow.com/users/103017', 'pm_score': 0, 'selected': False, 'text': '<p>How about setting up a server cache on the application server behind the component that encrypts https responses?  This can be useful if you have a reverse-proxy setup.</p>\n\n<p>I am thinking of something like this:</p>\n\n<pre><code>application server &lt;---&gt; Squid or Varnish (cache) &lt;---&gt; Apache (performs SSL encryption)\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/14656', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']