Zen Cart Logo
Forums / Addon Shipping Modules / UPS XML cURL error 35 - handshake failure

UPS XML cURL error 35 - handshake failure

Views: 2,929

Results 1 to 7 of 7
21 Aug 2014, 11:06 AM
#1
mikewithered avatar

mikewithered

New Zenner

Join Date:
Aug 2014
Location:
United States
Posts:
3
Plugin Contributions:
0

UPS XML cURL error 35 - handshake failure

Howdy, I'm stumped. UPS XML just stopped working within the last couple of days. I've been on google for half a day and can't find the smoking gun. I've verified my API key and log in info with UPS. I figure you guys will likely be able to aid much quicker than UPS support. So, thanks in advance for any help. I've got a nice new customer lined up and need this to work.

Cheers!

Here's my log file:

DATE AND TIME: 2014-08-21 10:59:34
UPS URL: https://wwwcie.ups.com:443/ups.app/xml/Rate
UPS REQUEST: <?xml version="1.0"?>
<AccessRequest xml:lang="en-US">
<AccessLicenseNumber>xxxxxx</AccessLicenseNumber>
<UserId>xxxxx</UserId>
<Password>xxxxxx</Password>
</AccessRequest>

<?xml version="1.0"?> <RatingServiceSelectionRequest xml:lang="en-US"> <Request> <TransactionReference> <CustomerContext>Rating and Service</CustomerContext> <XpciVersion>1.0001</XpciVersion> </TransactionReference> <RequestAction>Rate</RequestAction> <RequestOption>shop</RequestOption> </Request> <PickupType> <Code>01</Code> </PickupType> <Shipment> <Shipper> <Address> <City>Douglasville</City> <StateProvinceCode>GA</StateProvinceCode> <CountryCode>US</CountryCode> <PostalCode>30134</PostalCode> </Address> </Shipper> <ShipTo> <Address> <City>Douglasville</City> <StateProvinceCode>GA</StateProvinceCode> <CountryCode>US</CountryCode> <PostalCode>30134</PostalCode> <ResidentialAddressIndicator/> </Address> </ShipTo> <Package> <PackagingType> <Code>02</Code> </PackagingType> <PackageWeight> <UnitOfMeasurement> <Code>LBS</Code> </UnitOfMeasurement> <Weight>1.5</Weight> </PackageWeight> <PackageServiceOptions> <InsuredValue> <CurrencyCode>USD</CurrencyCode> <MonetaryValue>250</MonetaryValue> </InsuredValue> </PackageServiceOptions> </Package> </Shipment> <CustomerClassification> <Code>01</Code> </CustomerClassification> </RatingServiceSelectionRequest>

Error from cURL: Error [35]: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
UPS RESPONSE:

22 Aug 2014, 3:30 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: UPS XML cURL error 35 - handshake failure

Who are you hosting with?

What version php?

22 Aug 2014, 4:16 AM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: UPS XML cURL error 35 - handshake failure

I found a solution that worked for me on a GoDaddy hosting domain ...

Edit the file:
/includes/shipping/ups.php

and add these lines in RED:

      curl_setopt($ch, CURLOPT_URL, $url);
      // uncomment the next line if you get curl error 60: error setting certificate verify locations
      // curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
      // uncommenting the next line is most likely not necessary in case of error 60
      // curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
      curl_setopt($ch, CURLOPT_HEADER, 0);
      curl_setopt($ch, CURLOPT_POST, 1);
      curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlRequest);
      curl_setopt($ch, CURLOPT_TIMEOUT, (int)$timeout);

[B]      curl_setopt($ch, CURLOPT_SSLVERSION, 3);
      curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, 'SSLv3');
[/B]
      if ($this->logfile) {

see if that fixes the problem ...

Fortunately, I just went through the fun of setting up on a godaddy server for giggles and grins on testing and was able to reproduce this error as I could not on any other hosting provider that I test ...

22 Aug 2014, 12:19 PM
#4
mikewithered avatar

mikewithered

New Zenner

Join Date:
Aug 2014
Location:
United States
Posts:
3
Plugin Contributions:
0

Re: UPS XML cURL error 35 - handshake failure

You're amazing. That straightened me out completely! Yes, I'm using godaddy and PHP 5.4 I believe. I can't thank you enough for the help. I'm off to the donation page again. The strange thing is that it used to work. maybe godaddy changed something.

Thanks again!!!

22 Aug 2014, 12:45 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: UPS XML cURL error 35 - handshake failure

Thank you for confirming that this occured on a godaddy hosting as I haven't been able to duplicate this anywhere else ...

Thanks for letting us know that this works for you ...

26 Aug 2014, 9:35 PM
#6
gerrybakker avatar

gerrybakker

New Zenner

Join Date:
Dec 2009
Posts:
8
Plugin Contributions:
0

Re: UPS XML cURL error 35 - handshake failure

I had the same problem that showed up as an error in the client shopping cart that said:
"Rating and Service 1.0001 0 An unknown error occured while attempting to contact the UPS gateway : Rating and Service 1.0001 0 An unknown error occured while attempting to contact the UPS gateway"

I have been able to duplicate this and I think I know why. I just upgraded my server's php and mysql to latest recommended versions with much tighter security. That also upgraded many other things on the server as well. I suspect it was a new version of CURL tying down things tighter for security reasons and the latest version of SSL is what it wanted in order to get things working. I don't suspect it is a godaddy specific thing - it is something that will affect all of us as servers get upgraded to the latest versions.

That code will need to be added to "upsxml.php" on all of those newer servers.

Here is what my OS is now running and that suggest change fixed the problem on this server.
Apache 2.2.27 Running
DirectAdmin 1.45.4 Running
Exim 4.67 Running
MySQL 5.1.73 Running
Named 9.3.3rc2 Running
ProFTPd 1.3.5 Running
dovecot 2.2.13 Running
Php 5.3.29 Installed
curl 7.37.1

26 Aug 2014, 9:47 PM
#7
gerrybakker avatar

gerrybakker

New Zenner

Join Date:
Dec 2009
Posts:
8
Plugin Contributions:
0

Re: UPS XML cURL error 35 - handshake failure

Another note

I have Zencart 1.5.3 and the file needing the editing was:

/includes/modules/shipping/upsxml.php