trac 58 ssl enable SNI per vhost certs
http://libwebsockets.org/trac/libwebsockets/ticket/58#no1
This commit is contained in:
parent
28b12ad0af
commit
03203aba93
1 changed files with 16 additions and 0 deletions
16
lib/client.c
16
lib/client.c
|
@ -129,6 +129,22 @@ int lws_client_socket_service(struct libwebsocket_context *context,
|
|||
SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
|
||||
|
||||
|
||||
/* use server name indication (SNI), if supported,
|
||||
* when establishing connection */
|
||||
#ifdef USE_CYASSL
|
||||
#ifdef CYASSL_SNI_HOST_NAME
|
||||
const char *hostname = lws_hdr_simple_ptr(wsi,
|
||||
_WSI_TOKEN_CLIENT_PEER_ADDRESS);
|
||||
CyaSSL_UseSNI(wsi->ssl, CYASSL_SNI_HOST_NAME,
|
||||
hostname, strlen(hostname));
|
||||
#endif
|
||||
#else
|
||||
const char *hostname = lws_hdr_simple_ptr(wsi,
|
||||
_WSI_TOKEN_CLIENT_PEER_ADDRESS);
|
||||
SSL_set_tlsext_host_name(wsi->ssl, hostname);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef USE_CYASSL
|
||||
/*
|
||||
* CyaSSL does certificate verification differently
|
||||
|
|
Loading…
Add table
Reference in a new issue