Subversion Repositories oidplus

Rev

Rev 353 | Rev 484 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. <?php
  2.  
  3. /*
  4.  * OIDplus 2.0
  5.  * Copyright 2019 Daniel Marschall, ViaThinkSoft
  6.  *
  7.  * Licensed under the Apache License, Version 2.0 (the "License");
  8.  * you may not use this file except in compliance with the License.
  9.  * You may obtain a copy of the License at
  10.  *
  11.  *     http://www.apache.org/licenses/LICENSE-2.0
  12.  *
  13.  * Unless required by applicable law or agreed to in writing, software
  14.  * distributed under the License is distributed on an "AS IS" BASIS,
  15.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16.  * See the License for the specific language governing permissions and
  17.  * limitations under the License.
  18.  */
  19.  
  20. /*
  21.  
  22.         If this does not work, do following:
  23.  
  24.         Download:
  25.         https://curl.haxx.se/ca/cacert.pem
  26.  
  27.         Place it somewhere.
  28.  
  29.         Edit PHP.INI:
  30.         [curl]
  31.         curl.cainfo=C:\inetpub\cacert.pem
  32.  
  33. */
  34.  
  35. $url = 'https://www.viathinksoft.de/';
  36.  
  37. $ch = curl_init();
  38. curl_setopt($ch, CURLOPT_URL, $url);
  39. curl_setopt($ch, CURLOPT_HEADER, TRUE);
  40. curl_setopt($ch, CURLOPT_NOBODY, TRUE); // remove body
  41. curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  42. $head = curl_exec($ch);
  43. $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  44. curl_close($ch);
  45.  
  46. if ($httpCode != 0) {
  47.         echo '<font color="green">CURL to HTTPS works!</font>';
  48. } else {
  49.         echo '<font color="red">CURL to HTTPS does not work!</font>';
  50. }
  51.