php-general Digest 22 Mar 2011 23:11:16 -0000 Issue 7238
Topics (messages 311984 through 311989):
Re: SSL issues
311984 by: Bostjan Skufca
311985 by: Bostjan Skufca
echo?
311986 by: Jim Giner
311987 by: Daniel Brown
311988 by: Robert Cummings
311989 by: David Harkness
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
This works, but SSL-enabled socket connection does not. Will craft a
short script ASAP.
b.
On 22 March 2011 11:37, Richard Quadling <[email protected]> wrote:
> On 22 March 2011 01:21, Bostjan Skufca <[email protected]> wrote:
>> Hi all,
>>
>> is anyone else experiencing SSL connectivity issues with PHP 5.3(.5|6)?
>> PHP 5.2.17 compiled identically on the same system with the same
>> config file connects to remote SSL-enabled host just fine, whereas PHP
>> 5.3 (only tried .5 and .6) does not. Error message:
>>
>> Warning: stream_socket_client(): SSL operation failed with code 1.
>> OpenSSL Error messages:
>> error:140773F2:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert
>> unexpected message
>> Warning: stream_socket_client(): Failed to enable crypto
>>
>> Any ideas why this is happening?
>>
>> Thanks,
>> b.
>>
>> PS: With all the best efforts towards ditching PHP 5.2 this is a real
>> showstopper.
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
> I'm on Windows. Using 5-3-7-dev (my own build with php_openssl
> statically built rather than as a shared extension).
>
> php -d error_reporting=-1 -d display_errors=1 -r "echo
> file_get_contents('https://mail.google.com/mail');"
>
> and I get the correct content and no errors.
>
> Can you try the above command?
>
> Richard.
>
> --
> Richard Quadling
> Twitter : EE : Zend
> @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
>
--- End Message ---
--- Begin Message ---
I just remembered, I had "unrelated" issue yesterday with php 5.3.6.
It is used as standalone socket server with SSL connections and it
suddenly stopped working, server was receiving gibberish instead of
XML requests. I nailed it down to stream_set_blocking() which was set
to false for various daemon-related purposes. And when it was changed
to true the functionality was restored.
b.
On 22 March 2011 13:14, Bostjan Skufca <[email protected]> wrote:
> Will be more verbose ASAP, openssl is 0.9.8r... Just checked,
> connection to mail.google.com works, seems this is an issue specific
> to one server.
>
> b.
>
>
> On 22 March 2011 12:53, <[email protected]> wrote:
>> We've been using PHP 5.3.(5|6) since their released without any SSL issues.
>> We build PHP with OpenSSL (+FIPS), considering our product is in the real
>> world, we've had no complaints about connectivity issues via SSL. I compile
>> PHP with OpenSSL and the FIPS module frequently and haven't seen any of
>> these errors.
>>
>> When exactly are these errors occurring?
>> What version of OpenSSL are you compiling against?
>>
>> Any additional information would be helpful.
>>
>>
>>>---- Original Message ----
>>>From: Bostjan Skufca <[email protected]>
>>>To: "php-general" <[email protected]>
>>>Sent: Mon, Mar 21, 2011, 9:22 PM
>>>Subject: [PHP] SSL issues
>>>
>>>Hi all,
>>>
>>>is anyone else experiencing SSL connectivity issues with PHP 5.3(.5|6)?
>>>PHP 5.2.17 compiled identically on the same system with the same
>>>config file connects to remote SSL-enabled host just fine, whereas PHP
>>>5.3 (only tried .5 and .6) does not. Error message:
>>>
>>>Warning: stream_socket_client(): SSL operation failed with code 1.
>>>OpenSSL Error messages:
>>>error:140773F2:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert
>>>unexpected message
>>>Warning: stream_socket_client(): Failed to enable crypto
>>>
>>>Any ideas why this is happening?
>>>
>>>Thanks,
>>>b.
>>>
>>>PS: With all the best efforts towards ditching PHP 5.2 this is a real
>>>showstopper.
>>>
>>>--
>>>PHP General Mailing List (http://www.php.net/)
>>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
--- End Message ---
--- Begin Message ---
Kinda new to this, but I've been puttering/writing for about 3 weeks now and
have some good working screens up. Ran into something new while I was
debuggina script today.
Tried to echo the $i value within a for loop as part of the list of items I
was building
Something like
for ($i=0;$i<$rows;$i++)
echo $i.' '.$row['itemname'];
I expected to see :
1 item1
2 item2
...
...
but instead I got
1 item1
f item2
Yes - an 'f' and not a 2.
Tried it some more with this:
for ($i=1;$i<10;$i++)
echo $i." item".'<br>';
and got
c item
d item
e item
f item
g item
....
and so on.
It seems that I can only output the value of $i if I output a string in
front of it
echo ' '.$i;
works fine but
echo $i;
does not.
Any ideas?
--- End Message ---
--- Begin Message ---
On Tue, Mar 22, 2011 at 18:22, Jim Giner <[email protected]> wrote:
[snip!]
>
> for ($i=0;$i<$rows;$i++)
> echo $i.' '.$row['itemname'];
>
> I expected to see :
>
> 1 item1
> 2 item2
> ...
> ...
>
> but instead I got
>
> 1 item1
> f item2
>
> Yes - an 'f' and not a 2.
>
> Tried it some more with this:
>
> for ($i=1;$i<10;$i++)
> echo $i." item".'<br>';
>
> and got
>
> c item
> d item
> e item
> f item
> g item
> ....
> and so on.
That sounds very odd. Can you show us the actual surrounding code, Jim?
--
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/
--- End Message ---
--- Begin Message ---
On 11-03-22 06:22 PM, Jim Giner wrote:
Kinda new to this, but I've been puttering/writing for about 3 weeks now and
have some good working screens up. Ran into something new while I was
debuggina script today.
Tried to echo the $i value within a for loop as part of the list of items I
was building
Something like
for ($i=0;$i<$rows;$i++)
echo $i.' '.$row['itemname'];
I expected to see :
1 item1
2 item2
...
...
but instead I got
1 item1
f item2
Yes - an 'f' and not a 2.
Tried it some more with this:
for ($i=1;$i<10;$i++)
echo $i." item".'<br>';
and got
c item
d item
e item
f item
g item
....
and so on.
It seems that I can only output the value of $i if I output a string in
front of it
echo ' '.$i;
works fine but
echo $i;
does not.
Any ideas?
I'd like to see the actual code... since $row['itemname'] wouldn't
change between iterations either.
Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.
--- End Message ---
--- Begin Message ---
Are you sure?
$ php -a
php > for ($i = 0; $i < 10; $i++) { echo $i . ' '; }
0 1 2 3 4 5 6 7 8 9
David
--- End Message ---