Skip to content

Fix SN TLSSocket throwing when no application protocol - #3779

Open
reardonj wants to merge 1 commit into
typelevel:mainfrom
reardonj:3778-sn-tls-application-protocol
Open

reardonj wants to merge 1 commit into
typelevel:mainfrom
reardonj:3778-sn-tls-application-protocol

Conversation

@reardonj

Copy link
Copy Markdown
Contributor

Changes the behavior of applicationProtocol on SN to return the empty string when no protocol is negotiated, instead of throwing an exception. s2n_get_application_protocol intentionally returns NULL to indicate no protocol was negotiated (see: https://aws.github.io/s2n-tls/doxygen/s2n_8h.html#ae53faa26669e258afff875d45140f14e). But FS2 wrapped the call in guard which throws on a null pointer.

Fixes #3778

Changes the behavior of `applicationProtocol` on SN to return the empty string when no protocol is negotiated, instead of throwing an exception. `s2n_get_application_protocol` intentionally returns `NULL` to indicate no protocol was negotiated (see: https://aws.github.io/s2n-tls/doxygen/s2n_8h.html#ae53faa26669e258afff875d45140f14e). But FS2 wrapped the call in `guard` which throws on a null pointer.

Fixes typelevel#3778

This branch has not been deployed

No deployments
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.

Scala Native TLSSocket#applicationProtocol behavior is inconsistent with JVM

1 participant