Allow setting additional openssl CTX options from client applications (#600)#601
Open
mazer1310 wants to merge 1 commit into
Open
Allow setting additional openssl CTX options from client applications (#600)#601mazer1310 wants to merge 1 commit into
mazer1310 wants to merge 1 commit into
Conversation
… when calling SSL_CTX_set_options() during server or client Openssl handshakes (machinezone#600)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
OpenSSL 3.x behavior with respect to abruptly closed sockets when connecting to the WebSocket server results in spurious error messages. The workaround as described in openssl/openssl#22690 is to call
SSL_set_options(orSSL_CTX_set_optionswith optionSSL_OP_IGNORE_UNEXPECTED_EOF. However, IXWebSockets does not expose the ability to do so from client applications. (fixes #600)Fix
Add
int additional_openssl_ctx_optionstoix::SocketTLSOptions0, so the behavior is unchanged for existing applications.SSL_CTX_set_optionscalls during client and server socket handshakesSSL_CTX_set_optionsduringSocketOpenSSL::handleTLSOptionsto handle the client handshakeSSL_CTX_set_optionscall inSocketOpenSSL::acceptto handle the server handshakeVerification
Built the library on Linux RH8 and tested our application with and without setting
SocketTLSOptions::additional_openssl_ctx_optionstoSSL_OP_IGNORE_UNEXPECTED_EOFand confirmed that the application functions in both modes, but with the additional option the spurious error messages are squelched.