I have a classic C forking proxy in my LAN; now that I know "how to socket", I'd like to grant some privacy to it.
For instance, the browser extension HTTPS Everywhere (from its Wikipedia page),
It automatically makes websites use the more secure HTTPS connection instead of HTTP, if they support it.
If I'd use OpenSSL in my proxy, I'd make crypted connections: if my proxy receives a GET request (plain HTTP request for an unsafe connection), with OpenSSL I would protect that connection adding a layer of TLS to it.
But as reported in my quote above, HTTPS Everywhere makes a website use HTTPS connection if the site support it.
So, how can I check (with C code) if a given website supports HTTPS?
...please don't tell me it just needs to attempt a connection to remote server's port 443.