File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments