Add ALPN interface

This commit is contained in:
Manuel Pégourié-Gonnard 2014-04-04 16:08:41 +02:00
parent 6c33a16dae
commit 7e250d4812
3 changed files with 59 additions and 0 deletions

View file

@ -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 &&