SMF
SMF copied to clipboard
[2.1]: fetch_web_data() - sockets fails, cURL not attempted
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: https://github.com/SimpleMachines/SMF/blob/9ab8bffcea506dd35ead944be82ea38d6fcf8f3b/Sources/Subs.php#L6185
...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
- 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