gabrielbull / php-ups-api

PHP Wrapper for all UPS API
MIT License
456 stars 255 forks source link

cURL error 77 on Ups\Tracking #263

Closed matthric closed 4 years ago

matthric commented 5 years ago

Hi Folks,

I have everything setup using the example code but I am hitting what seems to be a cURL failure 77. It looks at first like it is a cert error but cURL CLI works fine against https servers...

Any help would be greatly appreciated

Thanks

Matt

My test PHP:

<?php
require __DIR__ . '/vendor/autoload.php';
use Ups\Tracking;

$accessKey = "<key>";
$userId = "<user>";
$password = "<pass>";

$tracking = new Ups\Tracking($accessKey, $userId, $password);

try {
    $shipment = $tracking->track('1Z61F3460440106844');

    foreach($shipment->Package->Activity as $activity) {
        var_dump($activity);
    }

} catch (Exception $e) {
    var_dump($e);
}

?>

And the output:

object(Ups\Exception\RequestException)#31 (7) { ["message":protected]=> string(81) "Failure: cURL error 77: (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(69) "/var/www/html/secure/admin/vendor/gabrielbull/ups-api/src/Request.php" ["line":protected]=> int(156) ["trace":"Exception":private]=> array(3) { [0]=> array(6) { ["file"]=> string(70) "/var/www/html/secure/admin/vendor/gabrielbull/ups-api/src/Tracking.php" ["line"]=> int(166) ["function"]=> string(7) "request" ["class"]=> string(11) "Ups\Request" ["type"]=> string(2) "->" ["args"]=> array(3) { [0]=> string(204) " trackingnumber myusername mypassword " [1]=> string(262) " Track activity 1Z61F3460440106844 " [2]=> string(45) "https://onlinetools.ups.com/ups.app/xml/Track" } } [1]=> array(6) { ["file"]=> string(70) "/var/www/html/secure/admin/vendor/gabrielbull/ups-api/src/Tracking.php" ["line"]=> int(103) ["function"]=> string(20) "getFormattedResponse" ["class"]=> string(12) "Ups\Tracking" ["type"]=> string(2) "->" ["args"]=> array(0) { } } [2]=> array(6) { ["file"]=> string(36) "/var/www/html/secure/admin/track.php" ["line"]=> int(13) ["function"]=> string(5) "track" ["class"]=> string(12) "Ups\Tracking" ["type"]=> string(2) "->" ["args"]=> array(1) { [0]=> string(18) "1Z61F3460440106844" } } } ["previous":"Exception":private]=> NULL } 
gabrielbull commented 4 years ago

@matthric This library has no maintainer and is looking for one.