-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ssl certificate issue for localhost (127.0.0.1) #1
Comments
I have also tried below mentioned code to check API response. But I am getting a blank response. "QUOTE", "name" => "Laura Behrens Wu", "company" => "Shippo", "street1" => "Clayton St.", "street_no" => "215", "street2" => "", "city" => "San Francisco", "state" => "CA", "zip" => "94117", "country" => "US", "phone" => "+1 555 341 9393", "email" => "laura@goshippo.com", "metadata" => "Customer ID 123456" ); ``` $_requestUrl = 'https://api.goshippo.com/v1/addresses/'; $userName = ''; $userPass = ''; $ch = curl_init($_requestUrl); $headers = array("Content-Type: application/json"); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET"); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($ch, CURLOPT_USERPWD, $userName.':'.$userPass); curl_setopt($ch, CURLOPT_POSTFIELDS, Zend_Json::Encode($address)); $response = curl_exec($ch); Mage::log('shippo address response:'); Mage::log($response); ``` ?> |
for localhost, a bruteforce workaround could be edit ApiRequestor.php and add these two lines
after
this will avoid to check for a valid certificate |
Things changed in 1.3.2
before
in CurlClient.php. Its around line 45 So bad we have to do it manually. Why not to disable the verifier automatically on test token? |
Another way around this issue is to download the cacert.pem hosted by curl and put it in I have the problem on a Windows 7 computer. |
@francois-g Better yet, thanks. |
Add support for type Bearer authorization header
we have to change following contents.
|
I have tried this api library for php on localhost but getting below metioned error.
Fatal error: Uncaught exception 'Shippo_ApiConnectionError' with message 'Unexpected error communicating with Shippo. If this problem persists, let us know by contacting us through our contact form. (Network error [errno 77]: error setting certificate verify locations: CAfile: /opt/lampp/htdocs/magento/shippo/lib/Shippo/../cacert.pem CApath: none )' in /opt/lampp/htdocs/magento/shippo/lib/Shippo/ApiRequestor.php:282 Stack trace: #0 /opt/lampp/htdocs/magento/shippo/lib/Shippo/ApiRequestor.php(250): Shippo_ApiRequestor->handleCurlError(77, 'error setting c...') #1 /opt/lampp/htdocs/magento/shippo/lib/Shippo/ApiRequestor.php(176): Shippo_ApiRequestor->_curlRequest('post', 'https://api.gos...', Array, Array) #2 /opt/lampp/htdocs/magento/shippo/lib/Shippo/ApiRequestor.php(101): Shippo_ApiRequestor->_requestRaw('post', '/v1/customs/dec...', Array) #3 /opt/lampp/htdocs/magento/shippo/lib/Shippo/ApiResource.php(107): Shippo_ApiRequestor->request('post', '/v1/customs/dec...', Array) #4 /opt/lampp/htdocs/magento/shippo/lib/Sh in /opt/lampp/htdocs/magento/shippo/lib/Shippo/ApiRequestor.php on line 282
The text was updated successfully, but these errors were encountered: