Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.1]: fetch_web_data() - sockets fails, cURL not attempted #8313

Open
sbulen opened this issue Sep 18, 2024 · 0 comments
Open

[2.1]: fetch_web_data() - sockets fails, cURL not attempted #8313

sbulen opened this issue Sep 18, 2024 · 0 comments

Comments

@sbulen
Copy link
Contributor

sbulen commented Sep 18, 2024

Basic Information

I ran into this testing a mod, so it's not strictly an SMF error, but I figured I'd log it for awareness, as it suggests fetch_web_data might need a tweak.

If sockets fails after the socket is open, e.g., on this line:

fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n");

...cURL is never attempted. I have run into several URLs where sockets fails there, but cURL works. Sockets seems to fail for ~15% of test URLs. Using cURL always works, so I am no longer using fetch_web_data at all, and directly using cURL instead.

I think it should realize fetch_web_data() isn't getting anywhere & move on to cURL...

Note the failure is with this message: "2: fwrite(): SSL: An established connection was aborted by the software in your host machine"

I'll be honest, l couldn't figure out how to get past that issue. Some of the materials I found suggested this is a CORS issue. In fact, I tried configuring CORS for these sites, and while it got further along, it still failed with the same message, just on a different line.

I don't know if 3.0 is affected also.

Steps to reproduce

  1. Sample url: https://sfpublicpress.org/news/feed

Expected result

I thought that if sockets failed, curl would be used

Actual result

curl was not attempted

Version/Git revision

2.1.4 & also current GitHub

Database Engine

All

Database Version

8.4

PHP Version

8.3.8

Logs

No response

Additional Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant