is_ssl() – Function | Developer.WordPress.org
Determines if SSL is used.