Created
July 6, 2018 05:16
-
-
Save kazuho/faeea2d37f228684fb7427c81be85293 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int save_client_hello(ptls_on_client_hello_t *self, ptls_t *tls, ptls_iovec_t server_name, const ptls_iovec_t *protocols, | |
size_t num_protocols, const uint16_t *signature_algorithms, size_t num_signature_algorithms) | |
{ | |
ptls_set_server_name(tls, (const char *)server_name.base, server_name.len); | |
#if 0 // you might want to save ALPN as well | |
ptls_set_negotiated_protocol(tls, (const char *)protocols[0].base, protocols[0].len); | |
#endif | |
return 0; | |
} | |
static ptls_context_t ctx = ...; | |
static ptls_on_client_hello_t on_client_hello = {save_client_hello}; | |
ctx.on_client_hello = &on_client_hello; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment