Skip to content

Commit f9b685d

Browse files
mrodgers-witekionashif
authored andcommitted
samples: http_server: add option to use ALPN for HTTP2 support
Add application level Kconfig option to enable ALPN usage for negotiating HTTP/2 connection with web browsers. Signed-off-by: Matt Rodgers <[email protected]>
1 parent bd83c19 commit f9b685d

File tree

1 file changed

+17
-0
lines changed
  • samples/net/sockets/http_server

1 file changed

+17
-0
lines changed

samples/net/sockets/http_server/Kconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,28 @@ config NET_SAMPLE_HTTPS_SERVICE
1818
bool "Enable https service"
1919
depends on NET_SOCKETS_SOCKOPT_TLS || TLS_CREDENTIALS
2020

21+
if NET_SAMPLE_HTTPS_SERVICE
22+
2123
config NET_SAMPLE_HTTPS_SERVER_SERVICE_PORT
2224
int "Port number for https service"
2325
default 443
2426
depends on NET_SAMPLE_HTTPS_SERVICE
2527

28+
config NET_SAMPLE_HTTPS_USE_ALPN
29+
bool "Allow HTTP2 connectivity with web browsers by using ALPN"
30+
select MBEDTLS_SSL_ALPN
31+
select HTTP_SERVER_TLS_USE_ALPN
32+
help
33+
Web browsers only use HTTP/2 over HTTPS, and use ALPN to determine if a
34+
server supports HTTP/2. If this option is enabled, web browsers can use
35+
HTTP/2 to communicate with the server. However web browsers are stricter
36+
with security when using HTTP/2, at a minimum you will need to add the CA
37+
certificate used to sign the server certificate into your web browser's
38+
trusted authorities. Otherwise the connection can fail with a security
39+
error, without giving an option to ignore this and proceed anyway.
40+
41+
endif # NET_SAMPLE_HTTPS_SERVICE
42+
2643
config NET_SAMPLE_PSK_HEADER_FILE
2744
string "Header file containing PSK"
2845
default "dummy_psk.h"

0 commit comments

Comments
 (0)