Connection reset by peer - Always the same but just for me

The issue is clearly with the SSL, you can see the full handshake on top which is missing from the jruby one. And it’s confirmed by that second test. Unfortunately I don’t know enough about jruby or SSL handshake to help you with this, but that gives you specific keywords to google and hopefully fix your installation.