]> granicus.if.org Git - esp-idf/commitdiff
Example 10_openssl_server should use TLSv1.2 instead of SSLv3; fixed corrupted HTTP...
authorMalte Janduda <mail@janduda.net>
Tue, 10 Jan 2017 20:48:15 +0000 (21:48 +0100)
committerAngus Gratton <angus@espressif.com>
Tue, 14 Feb 2017 04:38:37 +0000 (15:38 +1100)
examples/protocols/openssl_server/main/openssl_server.c

index 1eea2110cee73c306d8f685a90d7a4d4269c9ded..7569124f7f4423f3cf8c6cc591a2c9bd257da28b 100755 (executable)
@@ -37,7 +37,7 @@ const static char *TAG = "Openssl_demo";
 
 #define OPENSSL_DEMO_SERVER_ACK "HTTP/1.1 200 OK\r\n" \
                                 "Content-Type: text/html\r\n" \
-                                "Content-Length: 98\r\n" \
+                                "Content-Length: 98\r\n\r\n" \
                                 "<html>\r\n" \
                                 "<head>\r\n" \
                                 "<title>OpenSSL demo</title></head><body>\r\n" \
@@ -71,7 +71,7 @@ static void openssl_demo_thread(void *p)
     const unsigned int prvtkey_pem_bytes = prvtkey_pem_end - prvtkey_pem_start;   
 
     ESP_LOGI(TAG, "SSL server context create ......");
-    ctx = SSL_CTX_new(TLS_server_method());
+    ctx = SSL_CTX_new(TLSv1_2_server_method());
     if (!ctx) {
         ESP_LOGI(TAG, "failed");
         goto failed1;