updated getSite function in functions.php to support tls connections