SSL and fsockopen() in PHP4

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Bruno
Forum Newbie
Posts: 1
Joined: Thu Oct 13, 2005 5:38 am
Location: Holland

SSL and fsockopen() in PHP4

Post by Bruno »

Jcart | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]


Hi everyone,

I had this script that connects to a remote server over SSL, but I lost it
when moving my website to another server.
I had already struggled a lot in order to get the script working on the previous server.
And now that I am reconstructing it, I am running into trouble again.

I learned that [i]fsockopen()[/i] doesn't automatically support [i]SSL[/i]. 
However, by setting some option it could be enabled.
I have searched down php.net and came across [i]stream_context_set_option()[/i], 
but I cannot find the constants I need to indicate that I want to enable SSL.

Code: Select all

$fp=fsockopen("ssl://remotehost.org",5050, 13, "Not connected", 10);
	
	stream_context_set_option($fp,<wrapper: unknown>,<option:unknown>,<value:unknown>);

Jcart | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Post Reply