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

TLSv1.3 UserCanceled Event #454

Closed
wants to merge 1 commit into from
Closed

Conversation

ropwareJB
Copy link
Contributor

The TLSv1.3 closure event message user_canceled is unhandled, which will currently throw an exception as it will fall through to the "unexpected message" function clause here: https://github.com/haskell-tls/hs-tls/blob/ad16bdd849e594a8a429857dccefcd725a4d0d45/core/Network/TLS/Core.hs#LL186C1-L187C1

user_canceled: This alert notifies the recipient that the sender is
canceling the handshake for some reason unrelated to a protocol
failure. If a user cancels an operation after the handshake is
complete, just closing the connection by sending a "close_notify"
is more appropriate. This alert SHOULD be followed by a
"close_notify". This alert generally has AlertLevel=warning.

https://datatracker.ietf.org/doc/html/rfc8446#page-87

The spec reads as this message is informational and so I have left the handling code as a no-operation, just consuming the event. Perhaps a better approach would be to permit the user to override this.

@ropwareJB ropwareJB marked this pull request as ready for review June 4, 2023 11:25
@kazu-yamamoto kazu-yamamoto self-requested a review June 28, 2023 04:40
Copy link
Collaborator

@kazu-yamamoto kazu-yamamoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

kazu-yamamoto added a commit to kazu-yamamoto/hs-tls that referenced this pull request Jun 28, 2023
@kazu-yamamoto
Copy link
Collaborator

Sorry for the delay.
I have merged this PR.
Thanks!

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.

None yet

2 participants