NYCPHP Meetup

NYPHP.org

[nycphp-talk] Use php to check for ssl/https support in apache

Ken kenzolist at counterfolk.com
Fri Jul 14 20:44:45 EDT 2006


At 02:56 PM 7/14/2006 -0400, Rob Marscher wrote:
>I've done a bit of searching and haven't been able to find if there's a 
>means that php running on apache can determine if apache supports 
>ssl/https connections.  It would be nice my app to force an https 
>connection on certain pages if it is available.  Otherwise I'll have to 
>do it with a manual config switch.

In my own app, I wrote this test (years ago) that works on the Apache servers I've used it with:

No SSL if:
   (strpos($HTTP_SERVER_VARS["SERVER_SOFTWARE"], "ssl") === FALSE)

- Ken




More information about the talk mailing list