By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,304 Members | 1,253 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,304 IT Pros & Developers. It's quick & easy.

"SSL: Fatal Protocol Error" with fsockopen()

P: n/a
I'm experience the infamous "SSL: Fatal Protocol Error" bug with Apache 2.x

According the fopen() documentation:

"If you are using fsockopen() to create an ssl:// socket, you are
responsible for detecting and suppressing the warning yourself."

I have been unable to determine how to go about suppressing these warnings.
Any help would be greatly appreciated.
Feb 23 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
keychain wrote:
I'm experience the infamous "SSL: Fatal Protocol Error" bug with
Apache 2.x

According the fopen() documentation:

"If you are using fsockopen() to create an ssl:// socket, you are
responsible for detecting and suppressing the warning yourself."

I have been unable to determine how to go about suppressing these
warnings. Any help would be greatly appreciated.
You can supress warnings by putting an @ directly in front of the
function name, like this:

$handle = @fsockopen("ssl://server.example.com", 443);

--
Kim André Akerĝ
- ki******@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)
Feb 23 '07 #2

P: n/a
"Kim André Akerĝ" <ki******@NOSPAMbetadome.comwrote in message
news:54*************@mid.individual.net...
keychain wrote:
>I'm experience the infamous "SSL: Fatal Protocol Error" bug with
Apache 2.x

According the fopen() documentation:

"If you are using fsockopen() to create an ssl:// socket, you are
responsible for detecting and suppressing the warning yourself."

I have been unable to determine how to go about suppressing these
warnings. Any help would be greatly appreciated.

You can supress warnings by putting an @ directly in front of the
function name, like this:

$handle = @fsockopen("ssl://server.example.com", 443);

--
Kim André Akerĝ
- ki******@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)
Kim, that's a great tip--thanks!

You can optionally use

error_reporting(0);

but this suppresses all warnings, which is obviously less desirable.
Feb 23 '07 #3

P: n/a
Rik
keychain <so******@somewhere.comwrote:
"Kim André Akerĝ" <ki******@NOSPAMbetadome.comwrote
>>I'm experience the infamous "SSL: Fatal Protocol Error" bug with
Apache 2.x

According the fopen() documentation:

"If you are using fsockopen() to create an ssl:// socket, you are
responsible for detecting and suppressing the warning yourself."

I have been unable to determine how to go about suppressing these
warnings. Any help would be greatly appreciated.

You can supress warnings by putting an @ directly in front of the
function name, like this:

$handle = @fsockopen("ssl://server.example.com", 443);

Kim, that's a great tip--thanks!

You can optionally use

error_reporting(0);

but this suppresses all warnings, which is obviously less desirable.
Supressing warnings is not the way to go. What if something else fails
then the thing you expected to fail? Just set display_errors to false in
your configuration (php.ini/http.conf/.htaccess/php-script itself) and log
them to a file. Certainly advisable for live projects. Just parse the
error log once in a while to check wether something odd is going on, or
check it when something is indeed off or it grows with an alarming pace.

And BTW, error_reporting can be set back offcourse:
$temp = error_reporting(0);
fsockopen();
error_reporting($temp);
--
Rik Wasmus
Feb 23 '07 #4

P: n/a
"Rik" <lu************@hotmail.comwrote in message
news:op.tn7ycqprqnv3q9@misant...
keychain <so******@somewhere.comwrote:
>"Kim André Akerĝ" <ki******@NOSPAMbetadome.comwrote
>>>I'm experience the infamous "SSL: Fatal Protocol Error" bug with
Apache 2.x

According the fopen() documentation:

"If you are using fsockopen() to create an ssl:// socket, you are
responsible for detecting and suppressing the warning yourself."

I have been unable to determine how to go about suppressing these
warnings. Any help would be greatly appreciated.

You can supress warnings by putting an @ directly in front of the
function name, like this:

$handle = @fsockopen("ssl://server.example.com", 443);

Kim, that's a great tip--thanks!

You can optionally use

error_reporting(0);

but this suppresses all warnings, which is obviously less desirable.

Supressing warnings is not the way to go. What if something else fails
then the thing you expected to fail? Just set display_errors to false in
your configuration (php.ini/http.conf/.htaccess/php-script itself) and log
them to a file. Certainly advisable for live projects. Just parse the
error log once in a while to check wether something odd is going on, or
check it when something is indeed off or it grows with an alarming pace.

And BTW, error_reporting can be set back offcourse:
$temp = error_reporting(0);
fsockopen();
error_reporting($temp);
--
Rik Wasmus
Rik, thanks for your reply.

It turns out that using @ before the fsockopen() function doesn't suppress
the aforementioned SSL warrning. I therefore need to use one of the
techniques you described, which for my purposes will probably be the latter.
Feb 23 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.