Add a utility that checks if SslProvider.JDK supports ALPN#9693
Add a utility that checks if SslProvider.JDK supports ALPN#9693normanmaurer merged 1 commit intonetty:4.1from
Conversation
|
Can one of the admins verify this patch? |
|
@idelpivnitskiy after thinking a bit more about it I wonder if we not just want to add a method like this to SslContext and so make things easier for users to discover in the first place: |
|
@idelpivnitskiy let me know what you think... |
|
@normanmaurer agreed, discoverability will be better if we add a static method to Additional questions to discuss in this case:
|
|
Sounds like a plan 👌
… Am 21.10.2019 um 19:44 schrieb Idel Pivnitskiy ***@***.***>:
@normanmaurer agreed, discoverability will be better if we add a static method to SslContext class. However, SslContext has a lot of deprecated static methods. Not sure if we want to add a new one to this abstract class.
Alternative could be to add a similar static (or non-static) method directly to the SslProvider enum. That will help to avoid forgetting to update this method in case we add a new SslProvider and also good for discoverability, because the check is related to SslProvider.
Additional questions to discuss in this case:
Should we deprecate OpenSsl.isAlpnSupported() and suggest to use a new method?
Should we also add SslProvider.default() (or SslProvider.defaultForClient()/SslProvider.defaultForServer()) and deprecate SslContext.defaultClientProvider()/SslProvider.defaultServerProvider()? That will help to remove all public static methods from SslContext in the 5.0 version.
WDYT?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Motivation: We have a public utility `OpenSsl.isAlpnSupported()` that helps users to check if ALPN is available for `SslProvider.OPENSSL`. However, we do not provide a similar utility for `SslProvider.JDK`. Therefore, users who configured ALPN with `SslProvider.JDK` will get a runtime exception at the time when a new connection will be created. Modifications: - Add public `SslProvider.isAlpnSupported(SslProvider)` utility method that returns `true` if the `SslProvider` supports ALPN; - Deprecate `OpenSsl.isAlpnSupported()`; Result: Users can verify if their environment supports ALPN with `SslProvider.JDK` upfront (at bootstrap), instead of failing with runtime exception when a new connection will be created.
b7ed2e7 to
2426b09
Compare
|
@normanmaurer pushed the fix and updated commit message/PR description. |
|
@netty-bot test this please |
|
@idelpivnitskiy thanks a lot! |
Motivation: We have a public utility `OpenSsl.isAlpnSupported()` that helps users to check if ALPN is available for `SslProvider.OPENSSL`. However, we do not provide a similar utility for `SslProvider.JDK`. Therefore, users who configured ALPN with `SslProvider.JDK` will get a runtime exception at the time when a new connection will be created. Modifications: - Add public `SslProvider.isAlpnSupported(SslProvider)` utility method that returns `true` if the `SslProvider` supports ALPN; - Deprecate `OpenSsl.isAlpnSupported()`; Result: Users can verify if their environment supports ALPN with `SslProvider` upfront (at bootstrap), instead of failing with runtime exception when a new connection will be created.
Motivation:
We have a public utility
OpenSsl.isAlpnSupported()that helps users tocheck if ALPN is available for
SslProvider.OPENSSL. However, we do notprovide a similar utility for
SslProvider.JDK. Therefore, users whoconfigured ALPN with
SslProvider.JDKwill get a runtime exception atthe time when a new connection will be created.
Modifications:
SslProvider.isAlpnSupported(SslProvider)utility method thatreturns
trueif theSslProvidersupports ALPN;OpenSsl.isAlpnSupported();Result:
Users can verify if their environment supports ALPN with
SslProvider.JDKupfront (at bootstrap), instead of failing with runtimeexception when a new connection will be created.