Page 1 of 1

HTTPS (UPS Rates & Service Selection XML Tool)

Posted: Mon Jul 29, 2002 5:51 pm
by silk
I want to implement a rate quote system for a PHP e-mall and I decided to use UPS's service.
The problem is they only accept secure connections to this server: https://www.ups.com/ups.app/xml/Rate, on port 443.
Is there any way I can make this work? (I've heared fsockopen doesn't support https://).
If you can find a way to succesfully connect to this server, please let me know. Oh, don't type the address in the browser - it will display an acknoledgement from UPS, but that's not what I need :wink:
Thanks :cry:

Posted: Tue Jul 30, 2002 8:18 am
by volka
fopen-manual
As of PHP 4.3.0, if you have compiled in support for OpenSSL, you may use "https://" to open an HTTP connection over SSL.

Note that the file pointer allows you to retrieve only the body of the response; to retrieve the HTTP response header you need to be using PHP 4.0.5 or later; The headers will be stored in the $http_response_header variable. As of PHP 4.3.0, the header information can be retrieved using the file_get_wrapper_data().
so you may want to try out the announced "Alpha 2 of PHP w/ the Zend Engine 2" as tar.gz or windows binary

Thanks

Posted: Tue Jul 30, 2002 2:03 pm
by silk
Thanks, I'll try

Posted: Tue Jul 30, 2002 2:07 pm
by llimllib
The other easy way is to use the CURL library, which should handle more for you than fsockopen, but it may need SSL compiled in too (i think so)

cURL - OK

Posted: Tue Jul 30, 2002 3:36 pm
by silk
cURL seems to work, but there's a big problem: are those constants defined anywhere?

Posted: Tue Jul 30, 2002 11:16 pm
by llimllib
yeah, you can just use them like in the example; they're defined in the C code for the Curl functions.

Yeah!

Posted: Wed Jul 31, 2002 4:34 am
by silk
Got it to work!!!
Thanks, guys

any examples

Posted: Fri Jun 13, 2003 2:28 pm
by chadpry
any examples of some functioning code?

Posted: Fri Jun 13, 2003 3:56 pm
by Stoker
Take a look at these two threads
viewtopic.php?t=7148
viewtopic.php?t=9652