From cc3c59d4d5a98f6532b0013ba0c5e55e1f7ab4e7 Mon Sep 17 00:00:00 2001 From: Bozhidar Slaveykov Date: Tue, 12 Mar 2024 12:20:45 +0200 Subject: [PATCH] update --- plib/library/Helper.php | 18 ++++++++++++++++++ plib/library/Install.php | 19 +------------------ 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/plib/library/Helper.php b/plib/library/Helper.php index 052ebc8..848d7cd 100644 --- a/plib/library/Helper.php +++ b/plib/library/Helper.php @@ -406,4 +406,22 @@ public static function canIUpdateNewVersionOfApp() 'outdated_domains_ids'=>$outdatedDomainsIds ]; } + + public static function checkSsl($domainName) + { + $apiRequest = << + + + + $domainName + + + + +APICALL; + $response = json_decode(json_encode(pm_ApiRpc::getService()->call($apiRequest)), TRUE); + + + } } diff --git a/plib/library/Install.php b/plib/library/Install.php index 80add96..51629c4 100644 --- a/plib/library/Install.php +++ b/plib/library/Install.php @@ -105,7 +105,7 @@ public function run() { } if ($this->_ssl) { - if (!$this->checkSsl($domain->getName())) { + if (!Modules_Microweber_Helper::checkSsl($domain->getName())) { $this->addDomainEncryption($domain); } else { Modules_Microweber_Log::debug('Domain already have a SSL.'); @@ -430,23 +430,6 @@ public function run() { } - private function checkSsl($domainName) - { - try { - $g = @stream_context_create(array("ssl" => array("capture_peer_cert" => true))); - $r = @stream_socket_client("ssl://www." . $domainName . ":443", $errno, $errstr, 30, - STREAM_CLIENT_CONNECT, $g); - $cont = @stream_context_get_params($r); - if (isset($cont["options"]["ssl"]["peer_certificate"])) { - return true; - } - } catch (Exception $e) { - return false; - } - - return false; - } - private function addDomainEncryption($domain) { $artisan = false;