Page 1 of 1

Sending a https Request to Another Server.

Posted: Mon May 24, 2010 4:33 am
by mazzy_b
Please any one provide me the php code for Sending a https Request to Another Server.
Regards
Munish Bhargav

Re: Sending a https Request to Another Server.

Posted: Mon May 24, 2010 4:37 am
by Apollo
Look at the examples in the PHP manual for the fsockopen function.

Re: Sending a https Request to Another Server.

Posted: Mon May 24, 2010 5:56 am
by mazzy_b
Dear Apollo thanks for reply.
Dear I just have very few knowledge of PHP. and the post you provided is very long. It if very difficult to understand. Could you please provide me the actual code here and explain me a bit.
actually my requirement is exactly fulfill by this post

Thanks and Regards
Munish Bhargav

Re: Sending a https Request to Another Server.

Posted: Mon May 24, 2010 7:21 am
by Apollo
The code is exactly there, see "Example #1 fsockopen() Example".

If you really stuff like this, you're really better off by doing some study/research yourself to gain a better understanding of what's actually going on.

Re: Sending a https Request to Another Server.

Posted: Mon May 24, 2010 10:35 am
by John Cartwright
cURL is much more suitable than socket protocol implementations.

Code: Select all

$ch = curl_init('https://some_secure_url.com');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$return = curl_exec($ch); //contains response to HTTPS call

Re: Sending a https Request to Another Server.

Posted: Wed May 26, 2010 1:25 am
by mazzy_b
Thanks John Cartwright for reply,
i also need to send some data along with https request. would you provide me the code how would I achieve it.
Regards
Munish

Re: Sending a https Request to Another Server.

Posted: Wed May 26, 2010 11:58 am
by Jonah Bron