tbond Posted September 2, 2005 Share Posted September 2, 2005 Hi Gang! The Airborne or now called DHL Module is available. Download the DHL Airborne v1.41 in the Contributions->Shipping Modules area of the contributions page. First you need an account number, system ID, password and shipping key from DHL. Go to their site http://www.dhl.com/ and apply for an account. You have to give them all your info and credit card number of course. They email you the account number in a few hours usually, always less than 24 hours. Once you have that, you email [email protected] and ask for the System ID, Password and Shipping Key. They generate that for you and email it to you. That happens fast too if you do it before 6pm Paciific Time Monday to Friday. Once you have that, you can get DHL Module v1.41 to work. I did it with osCommerce 2.2 MS2. Here is how... WARNING: It may not work on your system due to a problem where your own server does not accept the SSL certificate from DHL for some reason. You'll know this happens if you turn on the debug in the module after successfully installing it with your System ID, Password, Account No., and Shipping Key you get from DHL after emailing them at [email protected]. Once you see the debug code and there is NO RESPONSE showing on the top of the screen from the server, you have the problem! Here is the fix. Have your server admin install the 'executable binary' of cURL so you can call it from the code, without having to go through the usual stuff about waiting for the SSL and so on. Open the file at catalog/includes/modules/shipping/dhlairborne.php and scroll down to line 388 or so until you see this code... ------------- code below -------------- // begin cURL engine & execute the request if (function_exists('curl_init')) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://eCommerce.airborne.com/$api"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "$request"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $airborne_response = curl_exec($ch); curl_close($ch); } else { // cURL method using exec() // curl -d -k if you have SSL issues exec("/usr/bin/curl -d \"$request\" https://eCommerce.airborne.com/$api", $response); $airborne_response = ''; foreach ($response as $key => $value) { $airborne_response .= "$value"; } } ------------- end of the code we're looking at ------------ Now, You are going to replace the code above with this code between the dotted lines... ------------- copy and replace the code above with this ----------- // begin cURL engine & execute the request ////if (function_exists('curl_init')) { //// $ch = curl_init(); // new tbond sep2-05 fix //// curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); //// curl_setopt($ch, CURLOPT_URL, "https://eCommerce.airborne.com/$api"); //// curl_setopt($ch, CURLOPT_HEADER, 0); //// curl_setopt($ch, CURLOPT_POST, 1); //// curl_setopt($ch, CURLOPT_POSTFIELDS, "$request"); //// curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //// $airborne_response = curl_exec($ch); //// curl_close($ch); ////} else { // cURL method using exec() // curl -d -k if you have SSL issues exec("/usr/bin/curl -k -d \"$request\" https://eCommerce.airborne.com/$api", $response); $airborne_response = ''; foreach ($response as $key => $value) { $airborne_response .= "$value"; } ////} ---------------- end of replaced code ----------------- NOTE: Don't copy or replace the dotted lines!!! What this does is tell your server to ignore the SSL certificate problems that it may encounter and to 'trust' the incoming response from DHL. That should fix the problem! BTW, if you have problems with your server admin doing this for you, I recommend our hosting company http://www.hostmysite.com/. We worked this out with Bill, one of their 24/7 dedicated hosting engineers. They offer reasonable hosting prices, linus and windows servers, and live answer-on-the-second-ring telephone support, 24/7. They're great! Good luck to everyone! -- Tom Bond, Webmaster http://www.americal.com/ Quote Link to comment Share on other sites More sharing options...
dreamscape Posted September 4, 2005 Share Posted September 4, 2005 (edited) This works well for a temporary fix, which is why I put that "curl -d -k if you have SSL issues" comment in the code. However, you really should look or encourage your system admin to look into updating the curl certificate bundles on the server. It is not that the DHL cert is invalid. It is very much valid. it is just that some servers do not "trust" it because those servers have old bundles they look at to determine if something should be trusted or not. Updating your curl cert bundles is not that difficult to do. ;) You can also get SSL issues if Curl or OpenSSL was incorrectly installed or configured, in which case, again I'd suggest encouraging your system admin to fix the problem, while using something like this as a temporary solution. Edited September 4, 2005 by dreamscape Quote The only thing necessary for evil to flourish is for good men to do nothing - Edmund Burke Link to comment Share on other sites More sharing options...
Guest Posted January 31, 2006 Share Posted January 31, 2006 Do you know how to do this if I am using Windows and not Linux for my Webserver, because I can't use "/usr/bin/curl" ? Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.