-
Notifications
You must be signed in to change notification settings - Fork 63
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
Provide a custom way to handle SSL exceptions #849
base: series/0.23
Are you sure you want to change the base?
Conversation
Same thing that was provided for ember (http4s/http4s#7093).
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.
This seems like a good addition to Blaze, but I suggest we consult Ross before making any decisions.
/** @param maxWrite | ||
* \@see [[SSLStageDefaults.MaxWrite]]. | ||
*/ |
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.
It seems like missing scaladoc
final class SSLStage( | ||
engine: SSLEngine, | ||
maxWrite: Int, | ||
sslHandshakeExceptionHandler: PartialFunction[Throwable, Unit] |
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.
If it's expected to handle SSLException
s only, shouldn't the contract be PF[SSLException, Unit]
?
*/ | ||
def withSslContext( | ||
sslContext: SSLContext, | ||
sslErrorHandler: PartialFunction[Throwable, Unit] = PartialFunction.empty, |
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.
Wouldn't it be more beneficial to have a general error handler exposed to users and not only for SSL exceptions?
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.
IIUC, Ember exposes a general error handler? https://github.com/http4s/http4s/blob/series/0.23/ember-server/shared/src/main/scala/org/http4s/ember/server/EmberServerBuilder.scala#L46-L47
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.
For what it's worth, Ember's general error handler just came up in http4s/http4s#7399. This is more in the direction that Ember is going, but probably away from the direction I'd prefer to go.
Same thing that was provided for ember (http4s/http4s#7093).