File tree Expand file tree Collapse file tree 1 file changed +9
-19
lines changed Expand file tree Collapse file tree 1 file changed +9
-19
lines changed Original file line number Diff line number Diff line change @@ -198,21 +198,6 @@ static int tls_context_server_alpn_select_callback(SSL *ssl,
198198 return result ;
199199}
200200
201- static int tls_context_client_alpn_select_callback (SSL * ssl ,
202- unsigned char * * out ,
203- unsigned char * outlen ,
204- const unsigned char * in ,
205- unsigned int inlen ,
206- void * arg )
207- {
208- return tls_context_server_alpn_select_callback (ssl ,
209- (const unsigned char * * ) out ,
210- outlen ,
211- in ,
212- inlen ,
213- arg );
214- }
215-
216201int tls_context_alpn_set (void * ctx_backend , const char * alpn )
217202{
218203 size_t wire_format_alpn_index ;
@@ -283,10 +268,15 @@ int tls_context_alpn_set(void *ctx_backend, const char *alpn)
283268 ctx );
284269 }
285270 else {
286- SSL_CTX_set_next_proto_select_cb (
287- ctx -> ctx ,
288- tls_context_client_alpn_select_callback ,
289- ctx );
271+ if (ctx -> alpn == NULL ) {
272+ return -1 ;
273+ }
274+ if (SSL_CTX_set_alpn_protos (
275+ ctx -> ctx ,
276+ (const unsigned char * ) & ctx -> alpn [1 ],
277+ (unsigned int ) ctx -> alpn [0 ]) != 0 ) {
278+ return -1 ;
279+ }
290280 }
291281 }
292282
You can’t perform that action at this time.
0 commit comments