mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 20:41:14 +00:00
examples/10_openssl_server: fixup SSL server with method of specific version
1. add method of any version supporting at OpenSSL and add API in header file 2. change OpenSSL server context method to be method of any version Fixes http://esp32.com/viewtopic.php?f=14&t=696.
This commit is contained in:
18
components/openssl/include/openssl/ssl.h
Normal file → Executable file
18
components/openssl/include/openssl/ssl.h
Normal file → Executable file
@@ -214,6 +214,14 @@ const SSL_METHOD* TLSv1_1_client_method(void);
|
||||
*/
|
||||
const SSL_METHOD* TLSv1_2_client_method(void);
|
||||
|
||||
/**
|
||||
* @brief create the target SSL context server method
|
||||
*
|
||||
* @param none
|
||||
*
|
||||
* @return the TLS any version SSL context client method
|
||||
*/
|
||||
const SSL_METHOD* TLS_client_method(void);
|
||||
|
||||
/**
|
||||
* @brief create the target SSL context server method
|
||||
@@ -260,6 +268,16 @@ const SSL_METHOD* TLSv1_server_method(void);
|
||||
*/
|
||||
const SSL_METHOD* SSLv3_server_method(void);
|
||||
|
||||
/**
|
||||
* @brief create the target SSL context server method
|
||||
*
|
||||
* @param none
|
||||
*
|
||||
* @return the TLS any version SSL context server method
|
||||
*/
|
||||
const SSL_METHOD* TLS_server_method(void);
|
||||
|
||||
|
||||
/**
|
||||
* @brief set the SSL context ALPN select callback function
|
||||
*
|
||||
|
3
components/openssl/platform/ssl_pm.c
Normal file → Executable file
3
components/openssl/platform/ssl_pm.c
Normal file → Executable file
@@ -125,6 +125,9 @@ int ssl_pm_new(SSL *ssl)
|
||||
|
||||
mbedtls_ssl_conf_max_version(&ssl_pm->conf, MBEDTLS_SSL_MAJOR_VERSION_3, version);
|
||||
mbedtls_ssl_conf_min_version(&ssl_pm->conf, MBEDTLS_SSL_MAJOR_VERSION_3, version);
|
||||
} else {
|
||||
mbedtls_ssl_conf_max_version(&ssl_pm->conf, MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_3);
|
||||
mbedtls_ssl_conf_min_version(&ssl_pm->conf, MBEDTLS_SSL_MAJOR_VERSION_3, MBEDTLS_SSL_MINOR_VERSION_0);
|
||||
}
|
||||
|
||||
mbedtls_ssl_conf_rng(&ssl_pm->conf, mbedtls_ctr_drbg_random, &ssl_pm->ctr_drbg);
|
||||
|
Reference in New Issue
Block a user