From a21f1090d0ed0349f1692e65b9a727e263931f5b Mon Sep 17 00:00:00 2001 From: Administrator Date: Sat, 11 Dec 2021 16:17:33 +0800 Subject: [PATCH] 1 --- src/Curl.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Curl.php b/src/Curl.php index b0a2e58..69232cf 100644 --- a/src/Curl.php +++ b/src/Curl.php @@ -116,16 +116,22 @@ class Curl extends ClientAbstracts } curl_setopt($resource, CURLOPT_CUSTOMREQUEST, strtoupper($method)); $this->client = $resource; + if (!empty($this->caPath)) { + curl_setopt($this->client,CURLOPT_CAINFO, $this->caPath); + } } + private string $caPath = ''; + + /** * @param $path * @return $this */ public function withCAInfo($path): static { - curl_setopt($this->client, CURLOPT_CAINFO, $path); + $this->caPath = $path; return $this; }