Skip to content
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

could we expose INVALID_ALPN_PROTOCOL? #101

Open
weissi opened this issue Apr 16, 2019 · 2 comments
Open

could we expose INVALID_ALPN_PROTOCOL? #101

weissi opened this issue Apr 16, 2019 · 2 comments
Labels
kind/enhancement Improvements to existing feature.

Comments

@weissi
Copy link
Member

weissi commented Apr 16, 2019

when connecting to https://cpanel.com with ALPN set to h2 we get

Channel caught error: handshakeFailed(NIOSSL.BoringSSLError.sslError([Error: 268435715 error:10000103:SSL routines:OPENSSL_internal:INVALID_ALPN_PROTOCOL, Error: 268435605 error:10000095:SSL routines:OPENSSL_internal:ERROR_PARSING_EXTENSION, Error: 268435646 error:100000be:SSL routines:OPENSSL_internal:PARSE_TLSEXT])) in handler5

could we expose that as a proper NIO error? Seems useful :)

@weissi weissi transferred this issue from apple/swift-nio-http2 Apr 16, 2019
@Lukasa
Copy link
Contributor

Lukasa commented Apr 17, 2019

The biggest problem here is that there's actually a stack of errors there. The associated data on BoringSSLError.sslError is [BoringSSLInternalError], which in this case is of length 3:

Error: 268435715 error:10000103:SSL routines:OPENSSL_internal:INVALID_ALPN_PROTOCOL
Error: 268435605 error:10000095:SSL routines:OPENSSL_internal:ERROR_PARSING_EXTENSION
Error: 268435646 error:100000be:SSL routines:OPENSSL_internal:PARSE_TLSEXT

What we can try to do is give some of these values static let constants on the BoringSSLInternalError structures, though doing so relies on some internal-ish functions in BoringSSL. This is because the error codes that back BoringSSLInternalError are in a packed form that needs to be generated in order to be matched upon.

If you're interested in that, let me know and I can put some of that together.

@weissi
Copy link
Member Author

weissi commented Apr 17, 2019

let's sit on it :)

@weissi weissi added the kind/enhancement Improvements to existing feature. label Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements to existing feature.
Projects
None yet
Development

No branches or pull requests

2 participants