apple/swift-nio-ssl

SSLContext.init should check the count of encodedApplicationProtocols, not applicationProtocols

Closed this issue · 0 comments

In SSLContext.init, we check whether we need to set the ALPN protocols by looking at whether the number of ALPN protocols is higher than zero. Unfortunately, we do so using the computed property TLSConfiguration.applicationProtocols instead of the base property TLSConfiguration.encodedApplicationProtocols. We should swap that check to avoid needing to do the expensive decoding work.