LucioFranco / tonic-openssl

MIT License
9 stars 13 forks source link

ALPN_H2_WIRE constant may be incorrect #8

Open lvkv opened 7 months ago

lvkv commented 7 months ago

There's a leading \x02 here that isn't in the RFC, which instead specifies b"h2": https://github.com/LucioFranco/tonic-openssl/blob/bdaaecda437949244a1b4d61cb39110c4bcad019/src/lib.rs#L31

I could be wrong, but this appears to have been a holdover from the transition from NPN to ALPN.

G1gg1L3s commented 7 months ago

It's probably this OpenSSL-specific encoding - https://www.openssl.org/docs/man3.3/man3/SSL_set_alpn_protos.html#NOTES

lvkv commented 6 months ago

Ah, so there's a leading 2 there because the length of "h2" is 2. I suppose that makes sense—I also only discovered this when switching from OpenSSL to Rustls.