feat(exmaples): remove wolfSSL example

The wolfSSL example will be supplied independently.
This commit is contained in:
dongheng
2019-10-10 13:53:24 +08:00
parent 5f2b5eafcf
commit 1f8192d9f9
29 changed files with 1 additions and 770 deletions

View File

@ -23,10 +23,6 @@
#include <sys/socket.h>
#if CONFIG_SSL_USING_WOLFSSL
#include "lwip/apps/sntp.h"
#endif
#include "openssl/ssl.h"
/* The examples use simple WiFi configuration that you can set via
@ -124,40 +120,6 @@ static void initialise_wifi(void)
ESP_ERROR_CHECK( esp_wifi_start() );
}
#if CONFIG_SSL_USING_WOLFSSL
static void get_time()
{
struct timeval now;
int sntp_retry_cnt = 0;
int sntp_retry_time = 0;
sntp_setoperatingmode(0);
sntp_setservername(0, "pool.ntp.org");
sntp_init();
while (1) {
for (int32_t i = 0; (i < (SNTP_RECV_TIMEOUT / 100)) && now.tv_sec < 1525952900; i++) {
vTaskDelay(100 / portTICK_RATE_MS);
gettimeofday(&now, NULL);
}
if (now.tv_sec < 1525952900) {
sntp_retry_time = SNTP_RECV_TIMEOUT << sntp_retry_cnt;
if (SNTP_RECV_TIMEOUT << (sntp_retry_cnt + 1) < SNTP_RETRY_TIMEOUT_MAX) {
sntp_retry_cnt ++;
}
printf("SNTP get time failed, retry after %d ms\n", sntp_retry_time);
vTaskDelay(sntp_retry_time / portTICK_RATE_MS);
} else {
printf("SNTP get time success\n");
break;
}
}
}
#endif
static void openssl_server_task(void* p)
{
int ret;
@ -179,11 +141,6 @@ static void openssl_server_task(void* p)
false, true, portMAX_DELAY);
ESP_LOGI(TAG, "Connected to AP");
#if CONFIG_SSL_USING_WOLFSSL
/* CA date verification need system time */
get_time();
#endif
printf("create SSL context ......");
ctx = SSL_CTX_new(TLSv1_2_server_method());