swift-nio-ssl: NIOSSL(Client|Server)Handler's init is throwing but that's not actionable

NIOSSLServerHandler’s init is throwing and that has two issues:

  1. it’s not really actionable so everybody writes try! NIOSSLServerHandler(context: sslContext). If that’s what we want, we can just do that in the init.
  2. it’s almost always used in the clientChannelInitializer where you have to return a future…

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Comments: 17 (17 by maintainers)

Commits related to this issue

Most upvoted comments

I checked with the NIO repository, just tried it on a separate throwing function there. We should get it hooked up here too really.

Thanks @wlisac! I think there also other such APIs that we should improve on.