Skip to content

Commit d49f807

Browse files
committed
Merge pull request #2273 from MPOS/wallet-https
[FIX] Do not verify SSL connections
2 parents 0c227cb + a56ef55 commit d49f807

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/lib/jsonRPCClient.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,17 @@ public function __call($method, $params) {
108108
curl_setopt($ch, CURLOPT_USERPWD, $url['user'] . ":" . $url['pass']);
109109
curl_setopt($ch, CURLOPT_POST, true);
110110
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
111+
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
112+
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
111113
$response = curl_exec($ch);
114+
if (curl_errno($ch)) throw new Exception('RPC call failed: ' . curl_error($ch));
112115
if ($this->debug) $this->debug_output[] = 'Response: ' . $response;
113116
$response = json_decode($response, true);
114117
$resultStatus = curl_getinfo($ch);
115118
if ($resultStatus['http_code'] != '200') {
116119
if ($resultStatus['http_code'] == '401') throw new Exception('RPC call did not return 200: Authentication failed');
117120
throw new Exception('RPC call did not return 200: HTTP error: ' . $resultStatus['http_code'] . ' - JSON Response: [' . @$response['error']['code'] . '] ' . @$response['error']['message']);
118121
}
119-
if (curl_errno($ch)) throw new Exception('RPC call failed: ' . curl_error($ch));
120122
curl_close($ch);
121123

122124
// final checks and return

0 commit comments

Comments
 (0)