Title: [BUG] https/ssl testing error
Last modified: August 21, 2016

---

# [BUG] https/ssl testing error

 *  [B M](https://wordpress.org/support/users/mampf/)
 * (@mampf)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/bug-httpsssl-testing-error/)
 * Hi,
 * you do use this code for testing if wer’re on https:
 *     ```
       /**
        Check if SSL is used
       */
       private static function isSSL() {
           return (isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off');
       }
       ```
   
 * This won’t work on every host. In fact, this _only_ works with mod_ssl. If you
   use [pound](http://www.apsis.ch/pound) (like [uberspace](https://wiki.uberspace.de/webserver:htaccess#ssl_erzwingen)),
   it just won’t work, because these variables will never be set. You’d need to 
   test %{ENV:HTTPS} instead.
 * Anyway. Why not just use [is_ssl](http://codex.wordpress.org/Function_Reference/is_ssl)
   provided by wordpress? This works!
 * Thanks,
    Ben
 * [https://wordpress.org/plugins/wp-piwik/](https://wordpress.org/plugins/wp-piwik/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [braekling](https://wordpress.org/support/users/braekling/)
 * (@braekling)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/bug-httpsssl-testing-error/#post-5047561)
 * Thank you. I will take account of this.

Viewing 1 replies (of 1 total)

The topic ‘[BUG] https/ssl testing error’ is closed to new replies.

 * ![](https://ps.w.org/wp-piwik/assets/icon-256x256.png?rev=3529668)
 * [Connect Matomo - Analytics Dashboard for WordPress](https://wordpress.org/plugins/wp-piwik/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-piwik/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-piwik/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-piwik/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-piwik/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-piwik/reviews/)

## Tags

 * [HTTPS](https://wordpress.org/support/topic-tag/https/)
 * [SSL](https://wordpress.org/support/topic-tag/ssl/)

 * 1 reply
 * 2 participants
 * Last reply from: [braekling](https://wordpress.org/support/users/braekling/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/bug-httpsssl-testing-error/#post-5047561)
 * Status: not resolved