Ruby 2.3.x requires the OpenSSL library version 1.0.x, however this version of the library has been deprecated for a while.
If you're using homebrew the library is no longer a Formula since the end of 2019, so you'll need a work-around to be able to install it. As the new openssl formula in homebrew-core is versioned, you can search for the old formula and extract it into any of your existing taps (we'll use homebrew/cask for simplicity, as most people have it installed).
# First extract the last existing version of the openssl unversioned formula into an existing tap
brew extract openssl homebrew/cask