John
John

Reputation: 41

check if ssl is enabled with php

I need to run a module that need ssl to be enabled. How can I detect if ssl has been enabled?

The module generate a form through a javascript call.

I am using php.

I have no access to ssl.

Thanks a lot!

Upvotes: 0

Views: 11686

Answers (1)

Acelasi Eu
Acelasi Eu

Reputation: 914

use the extension loaded check!

http://php.net/manual/en/function.extension-loaded.php

 if(!extension_loaded('openssl'))
    {
        throw new Exception('This app needs the Open SSL PHP extension.');
    }

try it ;)

Upvotes: 15

Related Questions