Mewp / lightopenid

Automatically exported from code.google.com/p/lightopenid
MIT License
4 stars 12 forks source link

PHP warning file_get_contents ssl connection reset by peer #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Not sure if this is related to issue 6, as it is also giving a warning with 
file_get_contents.
This is the error I'm getting when trying to login to Yahoo or Flickr (which is 
actually the same):

Warning: file_get_contents() [function.file-get-contents]: SSL: Connection 
reset by peer in /path/to/lightopenid/openid.php on line 212

If you need more info, please ask, as I'm not sure where to look for possible 
causes.

Original issue reported on code.google.com by benvanae...@gmail.com on 29 Oct 2010 at 7:57

GoogleCodeExporter commented 9 years ago
Can't really debug this. I've registered with Yahoo, tested it, and can 
reproduce the bug. However, I don't think that it's LightOpenID's fault. I've 
checked the network traffic with wireshark -- Yahoo's server is sending a TCP 
RST packet at the end of the connection, i.e. it's resetting it. I have no idea 
why does it do so, and I can't really fix it (otherwise than adding an @ before 
file_get_contents).

If you think of any better solution, please tell me.

Original comment by mewp...@gmail.com on 30 Oct 2010 at 12:08

GoogleCodeExporter commented 9 years ago
I also have the error "file_get_contents(): SSL: Connection reset by peer" 
while trying to login with Yahoo  via  "http://me.yahoo.com" identity.

With cURL everything worked perfectly.
Thanks a lot.

Original comment by o.vese...@gmail.com on 1 Nov 2010 at 6:26

GoogleCodeExporter commented 9 years ago
If I won't be able to fix it using php streams, I'll add the cURL support back 
(to be used by default if avaiable). However, since apparently not everyone has 
curl installed, I'd prefer a streams-based solution.

Original comment by mewp...@gmail.com on 2 Nov 2010 at 2:08

GoogleCodeExporter commented 9 years ago
I have added curl support again. It seems to work with yahoo without any 
problems.

Please verify that it works.

Original comment by mewp...@gmail.com on 7 Nov 2010 at 11:56

GoogleCodeExporter commented 9 years ago
is the new code already available?

Original comment by benvanae...@gmail.com on 7 Nov 2010 at 3:51

GoogleCodeExporter commented 9 years ago
Of course it is, on gitorious.

http://gitorious.org/lightopenid/lightopenid/archive-tarball/master

Original comment by mewp...@gmail.com on 7 Nov 2010 at 5:53

GoogleCodeExporter commented 9 years ago
Sorry, was searching in the wrong place :)
I can confirm that this issue is resolved... no problems at all when logging in 
with Yahoo!

sidenote: using identi.ca works now too.

Thanks for fixing the issue!

Original comment by benvanae...@gmail.com on 7 Nov 2010 at 10:57

GoogleCodeExporter commented 9 years ago
I run into this issue due to the save mode detection: `ini_get('safe_mode')`

If I remove the detection and use request_curl instead, it works fine.

Original comment by hunter...@gmail.com on 12 May 2011 at 12:33

GoogleCodeExporter commented 9 years ago
If you have safe_mode enabled and use curl, you get another warning instead 
(saying taht follow_location can't be used in safe_mode). And it's more common 
to get this warning than a connection reset from streams (which I can do 
nothing about), so I've decided to use streams with safe_mode.

Original comment by mewp...@gmail.com on 12 May 2011 at 8:22

GoogleCodeExporter commented 9 years ago
I was getting this same error only for yahoo logins.  (comparing to google).  
Turning off open_basedir fixed the issue.  Is there a better solution?  I have 
curl

Original comment by rich...@securebucket.com on 16 May 2011 at 1:10

GoogleCodeExporter commented 9 years ago
CURL does noe work well with either safe_mode or open_basedir, because in both 
cases, follow_location won't work. Since I can't really do anything about it, 
it's disabled by default if either open_basedir or safe_mode are enabled.

Original comment by mewp...@gmail.com on 16 May 2011 at 8:53

GoogleCodeExporter commented 9 years ago
When trying to log in with Yahoo I get that error message:
Warning: file_get_contents() [function.file-get-contents]: SSL: Connection 
reset by peer in /path/to/lightopenid/openid.php on line 345

Google on the other hand works perfectly. Any ideas?

Original comment by m...@janhohner.de on 11 Jan 2012 at 8:51

GoogleCodeExporter commented 9 years ago
Have you tried using cURL instead of stream wrappers?

As I've said in a previous message in this bug, I can't do anything with the 
stream wrappers to make it work.

Original comment by mewp...@gmail.com on 11 Jan 2012 at 10:31

GoogleCodeExporter commented 9 years ago
Ah ok, I overread that.
Unfortunately I cannot use cURL because my cloud host relies on open_basedir, 
so that won't work for me. I think I read about a fix for that cURL problem 
somewhere, I'll go looking for that.

Original comment by m...@janhohner.de on 12 Jan 2012 at 10:29

GoogleCodeExporter commented 9 years ago
I found the "fix" for the problem, and integrated it into the code. You can 
find it here: https://bitbucket.org/janhohner/janhohner-lightopenid/
Feel free to use my changes if you like them.

Original comment by m...@janhohner.de on 12 Jan 2012 at 2:25