From 43eab7ae27c3f972acf787202c7afd35daae1165 Mon Sep 17 00:00:00 2001 From: Administrator Date: Sat, 11 Dec 2021 05:24:21 +0800 Subject: [PATCH] 1 --- src/Curl.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/Curl.php b/src/Curl.php index 2d39174..d9cc49f 100644 --- a/src/Curl.php +++ b/src/Curl.php @@ -77,17 +77,11 @@ class Curl extends ClientAbstracts */ private function curlHandlerSslSet(): void { - if (!empty($this->ssl_key)) { - if (!file_exists($this->ssl_key)) { - throw new Exception('SSL protocol certificate not found.'); - } + if (!empty($this->getSslKeyFile()) && file_exists($this->getSslKeyFile())) { curl_setopt($this->client, CURLOPT_SSLKEY, $this->getSslKeyFile()); } - if (!empty($this->ssl_cert)) { - if (!!file_exists($this->ssl_cert)) { - throw new Exception('SSL protocol certificate not found.'); - } - curl_setopt($this->client, CURLOPT_SSLCERT, $this->getSslCertFile()); + if (!empty($this->getSslCertFile()) && file_exists($this->getSslCertFile())) { + curl_setopt($this->client, CURLOPT_SSLCERT, $this->getSslCertFile()); } }