@@ -43,6 +43,7 @@ WiFiClientSecure::WiFiClientSecure()
43
43
_pskIdent = NULL ;
44
44
_psKey = NULL ;
45
45
next = NULL ;
46
+ _alpn_protos = NULL ;
46
47
}
47
48
48
49
@@ -66,6 +67,7 @@ WiFiClientSecure::WiFiClientSecure(int sock)
66
67
_pskIdent = NULL ;
67
68
_psKey = NULL ;
68
69
next = NULL ;
70
+ _alpn_protos = NULL ;
69
71
}
70
72
71
73
WiFiClientSecure::~WiFiClientSecure ()
@@ -127,7 +129,7 @@ int WiFiClientSecure::connect(const char *host, uint16_t port, const char *CA_ce
127
129
if (_timeout > 0 ){
128
130
sslclient->handshake_timeout = _timeout;
129
131
}
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 );
131
133
_lastError = ret;
132
134
if (ret < 0 ) {
133
135
log_e (" start_ssl_client: %d" , ret);
@@ -147,7 +149,7 @@ int WiFiClientSecure::connect(const char *host, uint16_t port, const char *pskId
147
149
if (_timeout > 0 ){
148
150
sslclient->handshake_timeout = _timeout;
149
151
}
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 );
151
153
_lastError = ret;
152
154
if (ret < 0 ) {
153
155
log_e (" start_ssl_client: %d" , ret);
@@ -341,3 +343,8 @@ void WiFiClientSecure::setHandshakeTimeout(unsigned long handshake_timeout)
341
343
{
342
344
sslclient->handshake_timeout = handshake_timeout * 1000 ;
343
345
}
346
+
347
+ void WiFiClientSecure::setAlpnProtocols (const char **alpn_protos)
348
+ {
349
+ _alpn_protos = alpn_protos;
350
+ }
0 commit comments