SSL client handshake check not called #951
Open
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.
With the former ACE 6.1.7, I have observed that a SSL client sometimes fails to establish connection. It looks like a chicken-and-egg problem where the SSL handshake sometimes is completed when SSL_connect returns and sometimes it is not. Resulting in client post_handshake_check first being called later on when client attempts to read/write some data.
This may be a result of how we use ACE to initiate a connection.
But I found that when a ACE SSL client calls SSL_connect as part of do_SSL_state_machine and this returns 1 meaning:
"The TLS/SSL handshake was successfully completed, a TLS/SSL connection has been established."
see https://www.openssl.org/docs/man1.0.2/man3/SSL_connect.html
The do_SSL_handshake will also return 1 which according to the code comments means"SSL handshake is finished already, success". But this is not entirely true from a ACE perspective, as it did not call post_handshake_check.
Ensuring that post_handshake_check is called within the function, resolves the issue I observe.