Let me elaborate on this. In order for software to connect to a modern HTTPS server, one of the following things needs to happen.
- The software natively supports modern HTTPS, and connects without using our proxy.
- The software connects via our proxy, and trusts the Squid certificate.
Simple, right? Now, let's think of some scenarios that could cause things to go wrong.
- The software does not natively support modern HTTPS, and does not use our proxy. Obviously, this isn't going to work. The Dictionary app falls into this category; it works now because we added our own code to make the app do what we want.
- The software uses our proxy, but does not see the Squid certificate, and so assumes you're being hacked and does not work.
There are several possible causes for #2. The developer might have intentionally decided to ignore user certificates (certificate pinning), but it could also be because the software relies on its own certificate store rather than Keychain Access.
Software built against non-Apple versions of OpenSSL generally falls into the latter category. Ironically, this software probably
would work fine if it didn't use the proxy at all, because modern versions of OpenSSL natively support modern HTTPS protocols.
So, what determines whether an app connects via our proxy? Well, some use the proxy settings in System Preferences, and others look for an
HTTPS_PROXY
environment variable. The latest update to my proxy package automatically sets the
HTTPS_PROXY
environment variable so that more apps will use the proxy. However, if some apps read the environment variable, but do not use Keychain Access, they won't find the Squid certificate and will break.
Now, let's look at curl. Curl ignores System Preferences; to make it use a proxy, you need to set the
HTTPS_PROXY
environment variable.
The built-in Apple version of curl does not support modern HTTPS, but it does use Keychain Access. Without the environment variable set, it won't use the proxy, and won't work. If you set the environment variable, it works perfectly!
Versions of curl that are built with MacPorts are linked against modern copies of the OpenSSL library. This means they natively support modern HTTPS, but ignore Keychain Access. If you
don't set the environment variable, it works perfectly. If you set the variable, it breaks.
So, does this effect Ruby, Perl, Python, etc? I'm not sure, but it probably depends on whether you're using the copy that shipped with OS X, or a version linked against its own version of OpenSSL.