diff --git a/examples/09_openssl_client/README.md b/examples/09_openssl_client/README.md index 85d9575d6..a131cb247 100644 --- a/examples/09_openssl_client/README.md +++ b/examples/09_openssl_client/README.md @@ -6,7 +6,7 @@ First you should config the project by "make menuconfig": Example Configuration -> 1. Target Domain : the domain that you want to connect to, and default is "www.baidu.com". 2. Target port number : the port number of the target domain, and default is 443. - 3. WiFi SSID : you own wifi, which you pc is connected to alse, and default is "myssid". + 3. WiFi SSID : you own wifi, which is connected to the Internet, and default is "myssid". 4. WiFi Password : wifi password, and default is "mypassword" If you want to test the OpenSSL client demo: diff --git a/examples/09_openssl_client/main/component.mk b/examples/09_openssl_client/main/component.mk index 9c21f4a8d..44bd2b527 100644 --- a/examples/09_openssl_client/main/component.mk +++ b/examples/09_openssl_client/main/component.mk @@ -1,8 +1,3 @@ # # Main Makefile. This is basically the same as a component makefile. # -# This Makefile should, at the very least, just include $(IDF_PATH)/make/component_common.mk. By default, -# this will take the sources in the src/ directory, compile them and link them into -# lib(subdirectory_name).a in the build directory. This behaviour is entirely configurable, -# please read the ESP-IDF documents if you need to do this. -# diff --git a/examples/09_openssl_client/main/openssl_client.c b/examples/09_openssl_client/main/openssl_client.c index 9d4b8b395..890962f5d 100644 --- a/examples/09_openssl_client/main/openssl_client.c +++ b/examples/09_openssl_client/main/openssl_client.c @@ -55,9 +55,10 @@ void openssl_demo_thread(void *p) struct ip4_addr *ip4_addr; int recv_bytes = 0; - char send_data[] = OPENSSL_DEMO_REQUEST; - int send_bytes = sizeof(send_data); char recv_buf[OPENSSL_DEMO_RECV_BUF_LEN]; + + const char send_data[] = OPENSSL_DEMO_REQUEST; + const int send_bytes = sizeof(send_data); ESP_LOGI(TAG, "OpenSSL demo thread start OK"); @@ -171,7 +172,6 @@ static void openssl_client_init(void) { int ret; xTaskHandle openssl_handle; - extern void openssl_demo_thread(void *p); ret = xTaskCreate(openssl_demo_thread, OPENSSL_DEMO_THREAD_NAME, @@ -182,7 +182,6 @@ static void openssl_client_init(void) if (ret != pdPASS) { ESP_LOGI(TAG, "create thread %s failed", OPENSSL_DEMO_THREAD_NAME); - return ; } } diff --git a/examples/10_openssl_server/README.md b/examples/10_openssl_server/README.md index ae5c8da0c..a8c16d4ed 100644 --- a/examples/10_openssl_server/README.md +++ b/examples/10_openssl_server/README.md @@ -4,7 +4,7 @@ The Example contains of OpenSSL server demo. First you should configure the project by "make menuconfig": Example Configuration -> - 1. WiFi SSID: you own wifi that you pc is connected to alse. + 1. WiFi SSID: WiFi network to which your PC is also connected to. 1. WiFi Password: wifi password IF you want to test the OpenSSL server demo: diff --git a/examples/10_openssl_server/main/component.mk b/examples/10_openssl_server/main/component.mk index 4a891d52f..80af01cb5 100644 --- a/examples/10_openssl_server/main/component.mk +++ b/examples/10_openssl_server/main/component.mk @@ -1,11 +1,6 @@ # # Main Makefile. This is basically the same as a component makefile. # -# This Makefile should, at the very least, just include $(IDF_PATH)/make/component_common.mk. By default, -# this will take the sources in the src/ directory, compile them and link them into -# lib(subdirectory_name).a in the build directory. This behaviour is entirely configurable, -# please read the ESP-IDF documents if you need to do this. -# COMPONENT_EMBED_TXTFILES := cacert.pem COMPONENT_EMBED_TXTFILES += prvtkey.pem diff --git a/examples/10_openssl_server/main/openssl_server.c b/examples/10_openssl_server/main/openssl_server.c index 4fc841ac7..6dc28182d 100644 --- a/examples/10_openssl_server/main/openssl_server.c +++ b/examples/10_openssl_server/main/openssl_server.c @@ -65,10 +65,11 @@ static void openssl_demo_thread(void *p) socklen_t addr_len; struct sockaddr_in sock_addr; - char send_data[] = OPENSSL_DEMO_SERVER_ACK; - int send_bytes = sizeof(send_data); char recv_buf[OPENSSL_DEMO_RECV_BUF_LEN]; + const char send_data[] = OPENSSL_DEMO_SERVER_ACK; + const int send_bytes = sizeof(send_data); + extern const unsigned char cacert_pem_start[] asm("_binary_cacert_pem_start"); extern const unsigned char cacert_pem_end[] asm("_binary_cacert_pem_end"); const unsigned int cacert_pem_bytes = cacert_pem_end - cacert_pem_start; @@ -194,7 +195,6 @@ static void openssl_client_init(void) { int ret; xTaskHandle openssl_handle; - extern void openssl_demo_thread(void *p); ret = xTaskCreate(openssl_demo_thread, OPENSSL_DEMO_THREAD_NAME, @@ -205,7 +205,6 @@ static void openssl_client_init(void) if (ret != pdPASS) { ESP_LOGI(TAG, "create thread %s failed", OPENSSL_DEMO_THREAD_NAME); - return ; } }