mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-27 09:47:10 +01:00
Add ALPN interface
This commit is contained in:
parent
6c33a16dae
commit
7e250d4812
3 changed files with 59 additions and 0 deletions
|
|
@ -3520,6 +3520,10 @@ int ssl_session_reset( ssl_context *ssl )
|
|||
ssl->session = NULL;
|
||||
}
|
||||
|
||||
#if defined(POLARSSL_SSL_ALPN)
|
||||
ssl->alpn_chosen = NULL;
|
||||
#endif
|
||||
|
||||
if( ( ret = ssl_handshake_init( ssl ) ) != 0 )
|
||||
return( ret );
|
||||
|
||||
|
|
@ -3914,6 +3918,18 @@ void ssl_set_sni( ssl_context *ssl,
|
|||
}
|
||||
#endif /* POLARSSL_SSL_SERVER_NAME_INDICATION */
|
||||
|
||||
#if defined(POLARSSL_SSL_ALPN)
|
||||
void ssl_set_alpn_protocols( ssl_context *ssl, const char **protos )
|
||||
{
|
||||
ssl->alpn_list = protos;
|
||||
}
|
||||
|
||||
const char *ssl_get_alpn_protocol( const ssl_context *ssl )
|
||||
{
|
||||
return ssl->alpn_chosen;
|
||||
}
|
||||
#endif /* POLARSSL_SSL_ALPN */
|
||||
|
||||
void ssl_set_max_version( ssl_context *ssl, int major, int minor )
|
||||
{
|
||||
if( major >= SSL_MIN_MAJOR_VERSION && major <= SSL_MAX_MAJOR_VERSION &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue