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

Add USE_HTTP2 define #6959

Closed
wants to merge 2 commits into from
Closed

Add USE_HTTP2 define #6959

wants to merge 2 commits into from

Conversation

jsha
Copy link
Contributor

@jsha jsha commented Apr 25, 2021

This abstracts across the two HTTP/2 backends: nghttp2 and Hyper.

Add our own define for the "h2" ALPN protocol, so TLS backends can use
it without depending on a specific HTTP backend.

Fixes #6949.

@jsha jsha mentioned this pull request Apr 25, 2021
@bagder
Copy link
Member

bagder commented Apr 25, 2021

I think CMakeLists.txt also needs a fix for this?

@jsha
Copy link
Contributor Author

jsha commented Apr 25, 2021

I'm afraid I don't know CMake. Can you point me in roughly the right direction? I know I need to set the USE_HTTP2 #define when either Hyper or nghttp2 are enabled, but I can't see how #defines are added in the CMake config.

@bagder
Copy link
Member

bagder commented Apr 25, 2021

An alternative approach that works better independently of build system would be to mimic the QUIC way:

curl/lib/curl_setup.h

Lines 804 to 806 in 7843fe0

#if defined(USE_NGTCP2) || defined(USE_QUICHE)
#define ENABLE_QUIC
#endif

@bagder
Copy link
Member

bagder commented Apr 26, 2021

vtls/openssl.c:2717:24: error: incompatible pointer to integer conversion assigning to 'unsigned char' from 'const char [3]' [-Werror,-Wint-conversion]
      protocols[cur++] = ALPN_H2;

This abstracts across the two HTTP/2 backends: nghttp2 and Hyper.

Add our own define for the "h2" ALPN protocol, so TLS backends can use
it without depending on a specific HTTP backend.
@bagder
Copy link
Member

bagder commented Apr 27, 2021

It looks like nss needs something similar?

vtls/nss.c:2112:24: error: incompatible pointer to integer conversion assigning to 'unsigned char' from 'const char [3]' [-Werror,-Wint-conversion]
      protocols[cur++] = ALPN_H2;
                       ^ ~~~~~~~

Copy link

@Lionz01 Lionz01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

``

@bagder bagder closed this in a3268ec Apr 29, 2021
@bagder
Copy link
Member

bagder commented Apr 29, 2021

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

TLS backends rely on USE_NGHTTP2 to send "h2" ALPN
3 participants