Closed adfoster-r7 closed 2 years ago
This looks reasonable as long as this constant is available in all the project's supported Ruby versions.
Looks like it was introduced 5 years ago - https://github.com/ruby/openssl/commit/b44ab7f7e7e1c5f0cf618a347579d090b390103d#diff-09f822c26289f5347111795ca22ed7ed1cfadd6ebd28f987991d1d414eef565aR2674
And is pretty supported :+1:
$ docker run -it --rm -w $(pwd) -v $(pwd):$(pwd) ruby:2.5-alpine /bin/sh -c 'ruby -r openssl -e "puts OpenSSL::SSL::OP_LEGACY_SERVER_CONNECT.inspect"'
4
Relates to: https://github.com/rapid7/metasploit-framework/issues/16954
This PR fixes the following error in Metasploit-framework when the host machine has OpenSSL 3:
OpenSSL 1.x.x
Default SSLContext flags - used for Net HTTP
OP_ALL - used internally by rex-socket
OpenSSL 3
Default SSLContext flags - used for Net HTTP - missing OP_LEGACY_SERVER_CONNECT
OP_ALL - used internally by rex-socket
Without this change rex-socket connections break:
It's also possible to set
OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION
- which is technically what the error suggests to configureRaw example:
Without changes the following error occurs: