Skip to content

Commit 4f656b6

Browse files
committed
Don't verify SSL peer in debug enabled
1 parent ecc640c commit 4f656b6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Client.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ private function verbThePayload($verb, $payload)
9898
$data_string = json_encode(Helper::removeNulls($payload));
9999
curl_setopt($this->ch, CURLOPT_CUSTOMREQUEST, $verb);
100100
curl_setopt($this->ch, CURLOPT_POSTFIELDS, $data_string);
101-
if ($this->_debug) {
102-
curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, false);
103-
}
104101
curl_setopt($this->ch, CURLOPT_HTTPHEADER, array(
105102
'Accept: application/json',
106103
'Content-Type: application/json',
@@ -112,6 +109,9 @@ private function verbThePayload($verb, $payload)
112109

113110
private function sendRequest()
114111
{
112+
if ($this->_debug) {
113+
curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, false);
114+
}
115115
$this->curl_result = curl_exec($this->ch);
116116
$this->status = curl_getinfo($this->ch, CURLINFO_HTTP_CODE);
117117
}

0 commit comments

Comments
 (0)