@@ -43,6 +43,7 @@ WiFiClientSecure::WiFiClientSecure()
4343 _pskIdent = NULL ;
4444 _psKey = NULL ;
4545 next = NULL ;
46+ _alpn_protos = NULL ;
4647}
4748
4849
@@ -66,6 +67,7 @@ WiFiClientSecure::WiFiClientSecure(int sock)
6667 _pskIdent = NULL ;
6768 _psKey = NULL ;
6869 next = NULL ;
70+ _alpn_protos = NULL ;
6971}
7072
7173WiFiClientSecure::~WiFiClientSecure ()
@@ -127,7 +129,7 @@ int WiFiClientSecure::connect(const char *host, uint16_t port, const char *CA_ce
127129 if (_timeout > 0 ){
128130 sslclient->handshake_timeout = _timeout;
129131 }
130- int ret = start_ssl_client (sslclient, host, port, _timeout, CA_cert, cert, private_key, NULL , NULL , _use_insecure);
132+ int ret = start_ssl_client (sslclient, host, port, _timeout, CA_cert, cert, private_key, NULL , NULL , _use_insecure, _alpn_protos );
131133 _lastError = ret;
132134 if (ret < 0 ) {
133135 log_e (" start_ssl_client: %d" , ret);
@@ -147,7 +149,7 @@ int WiFiClientSecure::connect(const char *host, uint16_t port, const char *pskId
147149 if (_timeout > 0 ){
148150 sslclient->handshake_timeout = _timeout;
149151 }
150- int ret = start_ssl_client (sslclient, host, port, _timeout, NULL , NULL , NULL , pskIdent, psKey, _use_insecure);
152+ int ret = start_ssl_client (sslclient, host, port, _timeout, NULL , NULL , NULL , pskIdent, psKey, _use_insecure, _alpn_protos );
151153 _lastError = ret;
152154 if (ret < 0 ) {
153155 log_e (" start_ssl_client: %d" , ret);
@@ -341,3 +343,8 @@ void WiFiClientSecure::setHandshakeTimeout(unsigned long handshake_timeout)
341343{
342344 sslclient->handshake_timeout = handshake_timeout * 1000 ;
343345}
346+
347+ void WiFiClientSecure::setAlpnProtocols (const char **alpn_protos)
348+ {
349+ _alpn_protos = alpn_protos;
350+ }
0 commit comments