Only execute function if SSL is set up properly

There is no fail proof way to know if the site support https without actually trying to send a request over https to it (wp_get_remote for example). HTTPS traffic can be terminated on a load balancer and the traffic between it and wordpress done over http, therefor it is not obvious you will find any HTTPS specific configuration (there has to be one somewhere, but it will change from site to site).