Faraday::SSLError (SSL_read: unexpected eof while reading)

AI-generated summary

The user Jagster encountered a Faraday::SSLError (SSL_read: unexpected eof while reading) when trying to set up OAuth2 authentication between a Discourse forum and a WordPress site. Initially suspecting an OpenSSL version mismatch between Ubuntu 20.04 (WordPress) and Ubuntu 22.04 (Discourse), they attempted a system upgrade but the issue persisted. After further investigation, Jagster discovered that Nginx on the WordPress server was returning HTTP 444 errors for discovery requests, except when accessed directly. The root cause was identified as a misconfiguration in Nginx blocking requests from the Discourse server, which was mistakenly labeled as a bot. The issue was resolved by removing Faraday from the bot blocklist, highlighting the importance of checking server logs beyond the application level. Jagster concludes that the problem was not Discourse-related and suggests the topic may be deleted, though it could help others facing similar indirect issues.

I’m trying to get OAuth2 work between forum and Wordpress. But now when logged in to Wordpress and returning back to https://forum/auth/oauth2_basic/callback I get Oops and logs tell Faraday::SSLError (SSL_read: unexpected eof while reading)

What does that mean? And whos SSL that refers to? Google hits suggest quite often it is version related bug of OpenSSL but on wich end? But those suggestions were ~2 years old.

And yet I’m prone to do configuration errors really often too…

After very active googling it looks like the issue is version of OpenSSL. My Wordpress etc are on VPS that has Ubuntu 20.04 with OpenSSL 1.1.1f and that is the latest possible, But Discourse is under 22.04 and that uses OpenSSL 3.something.

So my headache is server where is Wordpress, not Discourse.

Well, I should move to newer Ubuntu. Yeah, and now we are deep in reason why I dislike all linuxes so much: I must move dozens plain Worpresses, one Woocommerce, two Moodles, Postfix, Varnish plus its addons, rebuild LAMP but with MariaDB, rebuild stack Nginx-Varnish-Apache, tune up crons, etc. Last time when I did that it took three days, and I’m not talking about working days…

Well, it’s my problem and mine only. I know that. And now I have to make a decission: do my users really need ability to login to forum using OpenID using Wordpress as provider.

Edit:

I did do-release-upgrade and after short testing it looks working. Things has been changed on DigitalOcean because when I tried 18 → 20 it was total catastroph.

But nothing changed, though.

  • OpenID can’t fetch discovery, but curl sees it
  • OAuth gives still that SSL error
  • DiscourseConnect is not an option, because it hijacks everything

i give up. This is not my cup of tea :man_shrugging:

Edit

God I’m stupid :man_facepalming: Because direct link and curl to discovery json worked I was so totallly sure the error must be on Discourse’s end. Now I checked logs of Nginx on wordpress-server and everytime when discovery was requested Nginx gave error 444 — except if that was made by me. After that solution was really easy: remove Faraday from my bad bot list.

I don’t know. This topic should be deleted, because it is not Discourse related. But sure — it can give a hint to someone, that think bit wider.