ankur0101 Posted June 2, 2011 Share Posted June 2, 2011 Hi friends I have following code function UseOfSSL($domain_name) { $site = ($domain_name); $port = 443; $fp = fsockopen($site,$port,$errno,$errstr,10); if(!$fp) { echo "Not Installed"; } else{ echo "Yes, it is installed"; fclose($fp); } } If domain name from $domain_name has installed SSL, it will show it is installed else not installed. Problem is that I tried this with both types of sites, those who are using SSL and those who are not and always, it says Yes, it is installed. 443 is used because https uses port 443 What is the cause ? Quote Link to comment Share on other sites More sharing options...
WebStyles Posted June 2, 2011 Share Posted June 2, 2011 have you tried: $site = 'ssl://'.$domain_name; ? Another forum has this code marked as working, although I did not test it, the difference seems to be the ssl:// part. <?php $SSL_Check = @fsockopen("ssl://www.domain.com/", 443, $errno, $errstr, 30); if (!$SSL_Check) { echo "SSL Not Available"; } else { echo "SSL Available"; fclose($SSL_Check); }?> hope this helps Quote Link to comment Share on other sites More sharing options...
ankur0101 Posted June 3, 2011 Author Share Posted June 3, 2011 Problem Solved. Thanks Quote Link to comment Share on other sites More sharing options...
ankur0101 Posted June 3, 2011 Author Share Posted June 3, 2011 It doesn't work with all domains. It is giving blank output for few domains Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.