-
Notifications
You must be signed in to change notification settings - Fork 620
Add TLSSocket.applicationProtocolOption
and better docs for TLSSocket.applicationProtocol
#3215
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,9 +38,19 @@ sealed trait TLSSocket[F[_]] extends Socket[F] with TLSSocketPlatform[F] { | |
def session: F[SSLSession] | ||
|
||
/** Provides access to the current application protocol that has been negotiated. | ||
* | ||
* Raises a [[NoSuchElementException]] if it has not yet been determined if application protocols might | ||
* be used for this connection. See [[applicationProtocolOption]] for a safer option. | ||
* | ||
* @see https://discord.com/channels/632277896739946517/632310980449402880/1100649913223745597 | ||
*/ | ||
def applicationProtocol: F[String] | ||
Comment on lines
40
to
47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can even deprecate this API to encourage the other one :) Not sure about linking to Discord. We should record anything important either in discussion on this PR or in code / comments themselves. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In my experience linking to Discord gives the perspective on back-and-forth that we had until we arrived at this. It's not super important, but it might give some insight into the context for a person looking at it. |
||
|
||
/** Provides access to the current application protocol that has been negotiated. | ||
* | ||
* Returns [[None]] if it has not yet been determined if application protocols might be used for this connection. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should include the bit about the empty
|
||
*/ | ||
def applicationProtocolOption: F[Option[String]] | ||
} | ||
|
||
object TLSSocket extends TLSSocketCompanionPlatform { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The doc says:
Is this actually equivalent to the empty string
""
case on the JVM? I'm not sure. On the JVMNone
is if it's not yet determined, but""
is if it's not being used (not being negotiated?).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am even less qualified to answer this question, not familiar with TLS enough :)