[openssl] Add support for SNI (sending the hostname)

This commit is contained in:
Kedar Sovani
2017-10-02 14:00:13 +05:30
parent 3420baa01b
commit b65f47c586
7 changed files with 40 additions and 2 deletions

View File

@@ -28,7 +28,7 @@
new, free, \
handshake, shutdown, clear, \
read, send, pending, \
set_fd, get_fd, \
set_fd, set_hostname, get_fd, \
set_bufflen, \
get_verify_result, \
get_state) \
@@ -42,6 +42,7 @@
send, \
pending, \
set_fd, \
set_hostname, \
get_fd, \
set_bufflen, \
get_verify_result, \

View File

@@ -259,6 +259,8 @@ struct ssl_method_func_st {
void (*ssl_set_fd)(SSL *ssl, int fd, int mode);
void (*ssl_set_hostname)(SSL *ssl, const char *hostname);
int (*ssl_get_fd)(const SSL *ssl, int mode);
void (*ssl_set_bufflen)(SSL *ssl, int len);

View File

@@ -145,6 +145,18 @@ int SSL_shutdown(SSL *ssl);
*/
int SSL_set_fd(SSL *ssl, int fd);
/**
* @brief Set the hostname for SNI
*
* @param ssl - the SSL context point
* @param hostname - pointer to the hostname
*
* @return result
* 1 : OK
* 0 : failed
*/
int SSL_set_tlsext_host_name(SSL* ssl, const char *hostname);
/**
* @brief These functions load the private key into the SSL_CTX or SSL object
*

View File

@@ -39,6 +39,8 @@ int ssl_pm_pending(const SSL *ssl);
void ssl_pm_set_fd(SSL *ssl, int fd, int mode);
int ssl_pm_get_fd(const SSL *ssl, int mode);
void ssl_pm_set_hostname(SSL *ssl, const char *hostname);
OSSL_HANDSHAKE_STATE ssl_pm_get_state(const SSL *ssl);
void ssl_pm_set_bufflen(SSL *ssl, int len);