Provide a custom way to handle SSL exceptions#849
Provide a custom way to handle SSL exceptions#849arturaz wants to merge 1 commit intohttp4s:series/0.23from
Conversation
Same thing that was provided for ember (http4s/http4s#7093).
danicheg
left a comment
There was a problem hiding this comment.
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.
It seems like missing scaladoc
| final class SSLStage( | ||
| engine: SSLEngine, | ||
| maxWrite: Int, | ||
| sslHandshakeExceptionHandler: PartialFunction[Throwable, Unit] |
There was a problem hiding this comment.
If it's expected to handle SSLExceptions 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.
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.
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.
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).