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

allow https server to accept and pass thru alpn protocols (IDFGH-8686) #10130

Merged
merged 2 commits into from
Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions components/esp_https_server/include/esp_https_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ struct httpd_ssl_config {

void *ssl_userdata; /*!< user data to add to the ssl context */
esp_tls_handshake_callback cert_select_cb; /*!< Certificate selection callback to use */

const char** alpn_protos; /*!< Application protocols the server supports in order of prefernece. Used for negotiating during the TLS handshake, first one the client supports is selected. The data structure must live as long as the https server itself! */
mahavirj marked this conversation as resolved.
Show resolved Hide resolved
};

typedef struct httpd_ssl_config httpd_ssl_config_t;
Expand Down Expand Up @@ -150,6 +152,7 @@ typedef struct httpd_ssl_config httpd_ssl_config_t;
.user_cb = NULL, \
.ssl_userdata = NULL, \
.cert_select_cb = NULL \
.alpn_protos = NULL \
}

/**
Expand Down
3 changes: 3 additions & 0 deletions components/esp_https_server/src/https_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ static httpd_ssl_ctx_t *create_secure_context(const struct httpd_ssl_config *con

cfg->userdata = config->ssl_userdata;


cfg->alpn_protos = config->alpn_protos;

#if defined(CONFIG_ESP_TLS_SERVER_CERT_SELECT_HOOK)
cfg->cert_select_cb = config->cert_select_cb;
#endif
Expand Down