Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handshake timeout may never be scheduled if handshake starts via a flush #8493

Closed
normanmaurer opened this issue Nov 11, 2018 · 1 comment
Closed
Assignees
Labels
Milestone

Comments

@normanmaurer
Copy link
Member

Reported by @tbrooks8:

A client (like my case) initiates the handshake in a flush call. The client hello message is generated and flushed. The SSLEngine now returns a handshake status of NEED_UNWRAP.

The channelActive call happens, since the handshake status is not HandshakeStatus.NOT_HANDSHAKING (line 1740), the method returns immediately without scheduling a timeout. There is now no timeout for this handshake.

The flush route for starting a handshake does not called startHandshakeProcessing. That is only called when the handler is added and the channel is already active or in the channelActive call. The flush route allows for the SSLEngine handshake to start prior to these things happening. And then the status of the engine, causes the handshake(final Promise newHandshakePromise) method to exit early.

This was reported as part of #8486

@normanmaurer
Copy link
Member Author

The same is also true when starttls is used.

@normanmaurer normanmaurer added this to the 4.1.32.Final milestone Nov 11, 2018
@normanmaurer normanmaurer self-assigned this Nov 11, 2018
normanmaurer added a commit that referenced this issue Nov 11, 2018
…ush or starttls is used.

Motivation:

We did not correctly schedule the handshake timeout if the handshake was either started by a flush(...) or if starttls was used.

Modifications:

- Correctly setup timeout in all cases
- Add unit tests.

Result:

Fixes #8493.
normanmaurer added a commit that referenced this issue Nov 13, 2018
…ush or starttls is used. (#8494)

Motivation:

We did not correctly schedule the handshake timeout if the handshake was either started by a flush(...) or if starttls was used.

Modifications:

- Correctly setup timeout in all cases
- Add unit tests.

Result:

Fixes #8493.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant