Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

There is a desktop client A connecting to website W in a https connection

A --> W

Somehow between A and W, there is a proxy G.

A --> G --> W
  • In this case, will G be able to get the certificate which A previously got from W?
  • If G can get the certificate, does that mean that G will be able to decrypt the data?
share|improve this question
add comment

2 Answers

How does https work?

Https is based on public/private-key cryptography. This basically means that there is a key pair: The public key is used for encryption and the secret private key is required for decryption.

A certificate is basically a public key with a label identifying the owner.

So when your browser connects to an https server, it will answer with his certificate. The browser checks if the certificate is valid:

  • The owner information need to match the server name that the user requested.
  • The certificate needs to be signed by a trusted certification authority.

If one of these conditions is not met, the user is informed about the problem.

After the verification, the browser extracts the public key and uses it to encrypt some information before sending it to the server. The server can decrypt it because the server has the matching private key.

How does https prevent man in the middle attacks?

In this case, will G be able to get the certificate which A previously got from W?

Yes, the certificate is the public key with the label. The webserver will send it to anyone who connects to it.

If G can get the certificate, does that mean that G will be able to decrypt the data?

No. The certificate contains the public key of the webserver. The malicious proxy is not in the possession of the matching private key. So if the proxy forwards the real certificate to the client, it cannot decrypt information the client sends to the webserver.

The proxy server may try to forge the certificate and provide his own public key instead. This will, however, destroy the signature of the certification authorities. The browser will warn about the invalid certificate.

Is there a way a proxy server can read https?

If the administrator of your computer cooperates, it is possible for a proxy server to sniff https connections. This is used in some companies to in order to scan for viruses and to enforce guidelines of acceptable use.

A local certification authority is setup and the administrator tells your browser that this CA is trustworthy. The proxy server uses this CA to sign his forged certificates.

Oh and of course, user tend to click security warnings away.

share|improve this answer
If the administrator and the computer cooperates, so there won't be certificate warnings. How can the user know if the proxy listens to the conversation? Afaik my company scans https, but I don't see the self signed certificate in the chain trust when I examine the certificates of https sites. –  Calmarius Jun 12 '13 at 10:31
You can detect it. 1st your company certificate isn't a self signed one. It is a certificate duly signed by an authority wich is automagically embedded within all the Internet Explorer of the world. To detect all magic certificates allowances without your notice, there is one uniq but hard path. Remove all the magically authorized root certificates within your Internet Explorer. From this starting point, you will have to accept explictly all servers certificates . You will have to read, understand them, and accept the ones you trust. –  daniel Azuelos Jan 6 at 21:40
add comment

Assuming that users do not click through cert warnings (and assuming that you are running an unmodified client), the answer is: No, the proxy cannot decrypt the data.

For a detailed explanation of how HTTPS prevents a man-in-the-middle from decrypting your traffic, see any standard resource on SSL/TLS, e.g.,

P.S. The certificate is public data. It contains the server's public key and domain name, neither of which are secret. Observing the certificate does not help the attacker to decrypt the data. (Yes, the proxy can observe the certificate, but this is harmless.)

share|improve this answer
Assuming no root CA gets popped and loses control of its private key. –  devnul3 Oct 22 '11 at 19:14
It's a fair assumption that (root and delegated) CAs will supply bogus certificates to their national intelligence agencies. Apparently there have been, presumably accidental, public marketing of proxy devices that use these sorts of certificates. –  Tom Hawtin - tackline Oct 25 '11 at 0:23
Actually Blue Coat ProxySG has been doing MiTM on HTTPS for a long time now by depending on custom trusted certificates being installed on clients accessing through them, basically pretending to be CA on top of being a caching proxy. Similar are doing Nokia, Opera mobile, Amazon Kindle, e.t.c., by installing trusted root certificates on their clients, and then proxying all requests through their spoofed CA servers. In short, anyone that claims or appears to be caching, re-compressing or otherwise optimizing HTTPS contents 'in between' is doing it. –  TildalWave Apr 22 '13 at 19:36
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.