Allocate the underlying OpenSSL object in #initialize{,_copy} instead of .allocate. Allocating an empty OpenSSL object in .allocate is wasteful because #initialize{,_copy} cannot always reuse an existing object and have to allocate a new...rhenium (Kazuki Yamaguchi)
Allocate the wrapper object before attempting to load the provider. Also, expand macros NewProvider() and SetProvider(), which are only used once and are unlikely to be reused in the future. https://github.com/ruby/openssl/commit/f62cc...rhenium (Kazuki Yamaguchi)
Simplify the code and raise exceptions with a consistent error message. This unifies the exception type raised when #initialize is called twice to TypeError. This should not affect valid usage of these classes. https://github.com/ruby/...rhenium (Kazuki Yamaguchi)
We can implement this now that we require Ruby 2.7 or later. The return value of OpenSSL's *_set_ex_data() functions is not checked since replacing an existing index should not fail. https://github.com/ruby/openssl/commit/98acd95e86rhenium (Kazuki Yamaguchi)