This commit is contained in:
2021-12-11 16:17:33 +08:00
parent 65958a0ded
commit a21f1090d0
+7 -1
View File
@@ -116,16 +116,22 @@ class Curl extends ClientAbstracts
} }
curl_setopt($resource, CURLOPT_CUSTOMREQUEST, strtoupper($method)); curl_setopt($resource, CURLOPT_CUSTOMREQUEST, strtoupper($method));
$this->client = $resource; $this->client = $resource;
if (!empty($this->caPath)) {
curl_setopt($this->client,CURLOPT_CAINFO, $this->caPath);
}
} }
private string $caPath = '';
/** /**
* @param $path * @param $path
* @return $this * @return $this
*/ */
public function withCAInfo($path): static public function withCAInfo($path): static
{ {
curl_setopt($this->client, CURLOPT_CAINFO, $path); $this->caPath = $path;
return $this; return $this;
} }