Created attachment 533362 [details, diff] ruby-2.4.4 patch Taken from https://github.com/ruby/openssl/pull/193 and path adapted.
Created attachment 533366 [details, diff] ruby-2.5.1 patch
https://github.com/gentoo/libressl/commit/4ddb06af0a16fada98ef624a0ddde5780d5757f8 "Fix ruby to work with libressl >= 2.7" works
These patches have been applied to ruby-2.4.4-r1 and ruby-2.5.1-r1.