Sorting out why the openssl v3.0.1 RubyGem wouldn't work on OpenBSD was a hellish job. The --with-openssl-dir option didn't work, because it expected a Linux path. Aaarrrgghhh!
The repo version (3.1.0.pre) fixes it. Took me way too long to discover that.