Wednesday, March 16, 2011

How to get Https URL content

Hi all

I have a https link that requires user login & password. If I run it in FX like this: https://usernameassword@www.example.com/link/sublink

it will return the xml data as expected.

However, what i'm trying to do, is to automate this process. I try to use file_get_contents in PHP fSocket in PHP

I even try Ajax, but still.. doesn't work.

and try to get the content (xml) either in Server or in the front-end (ajax), but both don't work.

Does anyone know what I need to go in order to get the content? Do I need to obtain the ssl certificate?

Solution in any ohter languages will be welcome too.

From stackoverflow
  • You should use curl library, also certificate should be verified if you want to prevent man-in-the-middle attacks. Or just ignore it using curl options.

  • cURL or wget with SSL support.

    cURL, you can run either through the compiled PHP library or call the executable from PHP.

    Wget, you will have to call the executable.

  • How about in Java?

  • Use libcurl via its Java bindings.

0 comments:

Post a Comment