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

fix: avoid never ending loop when peer sends close notify during TLS handshake #143

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

felipeek
Copy link

@felipeek felipeek commented Sep 6, 2024

When acting as a client, if the peer sends a closeNotify message during the TLS handshake, a bug may occur in which wildfly becomes stuck in the unwrap or wrap functions. This happens because the underlying sslEngine.[un]wrap functions eventually return a result with status CLOSED and with 0 bytes consumed, but the caller does not handle it properly, and simply proceed to the next iteration even though no data was consumed.

This issue is easily reproduced by setting up a custom TLS server that forcefully emits closeNotify messages during the handshake, using wildfly engine as a client connection, and observing the behavior.

The proposed modifications seems to fix the issue.

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

Successfully merging this pull request may close these issues.

1 participant