https on gov site causing errors
authorAlan Knowles <alan@roojs.com>
Wed, 11 Aug 2021 08:38:38 +0000 (16:38 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 11 Aug 2021 08:38:38 +0000 (16:38 +0800)
DataObjects/Core_holiday.php

index b453133..52a13c5 100644 (file)
@@ -43,7 +43,14 @@ class Pman_Core_DataObjects_Core_holiday extends DB_DataObject
         
         
         
-        $data = file_get_contents("http://www.1823.gov.hk/common/ical/gc/en.ics");
+        $data = file_get_contents("https://www.1823.gov.hk/common/ical/gc/en.ics", false,
+            stream_context_create(array(
+                "ssl"=>array(
+                    "verify_peer"=>false,
+                    "verify_peer_name"=>false,
+                ),
+            ))
+        );
         
         $vevents = explode('BEGIN:VEVENT', $data);