Try replacing discourse/config/initializers/013-excon_defaults.rb at main · discourse/discourse · GitHub with:
require "excon"
Excon::DEFAULTS[:include_default_port] = true
Due to a misconfiguration of Excon, the port number was not being passed when using an HTTP proxy. Consequently, the proxy server was connecting to the remote server using port 80, while Excon was still attempting to decrypt the HTTP content using TLS.