aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlv-426 <oxcafebaby@yahoo.com>2008-09-08 22:39:05 +0000
committerlv-426 <oxcafebaby@yahoo.com>2008-09-08 22:39:05 +0000
commit04a3265002dbc3971c3ed0e552565d3c9e53754f (patch)
tree6dced28931d1b4f2fab63df668771746d8f232b4 /src
parent4f5e8029080c325197950cbea29ac24fd074b90f (diff)
downloadlibmicrohttpd-04a3265002dbc3971c3ed0e552565d3c9e53754f.tar.gz
libmicrohttpd-04a3265002dbc3971c3ed0e552565d3c9e53754f.zip
some test fixes
tls connection teardown upon unrecognized message type connection state dictionary compiles based on 'enable_messages'
Diffstat (limited to 'src')
-rw-r--r--src/daemon/connection_https.c13
-rw-r--r--src/daemon/https/tls/gnutls_buffers.c13
-rw-r--r--src/daemon/https/tls/gnutls_str.c27
-rw-r--r--src/daemon/https/tls/gnutls_str.h3
-rw-r--r--src/daemon/internal.c8
-rw-r--r--src/daemon/internal.h4
-rw-r--r--src/examples/Makefile.am8
-rw-r--r--src/examples/https_fileserver_example.c (renamed from src/examples/https_server_example.c)44
-rw-r--r--src/testcurl/https/tls_daemon_options_test.c10
-rw-r--r--src/testcurl/https/tls_session_time_out_test.c1
10 files changed, 55 insertions, 76 deletions
diff --git a/src/daemon/connection_https.c b/src/daemon/connection_https.c
index df91af10..20baa770 100644
--- a/src/daemon/connection_https.c
+++ b/src/daemon/connection_https.c
@@ -87,7 +87,7 @@ MHD_get_connection_info (struct MHD_Connection *connection,
87/** 87/**
88 * This function is called once a secure connection has been marked 88 * This function is called once a secure connection has been marked
89 * for closure. 89 * for closure.
90 * 90 *
91 * NOTE: Some code duplication with connection_close_error 91 * NOTE: Some code duplication with connection_close_error
92 * in connection.c 92 * in connection.c
93 * 93 *
@@ -216,6 +216,7 @@ MHD_tls_connection_handle_read (struct MHD_Connection *connection)
216 { 216 {
217 /* set connection state to enable HTTP processing */ 217 /* set connection state to enable HTTP processing */
218 connection->state = MHD_CONNECTION_INIT; 218 connection->state = MHD_CONNECTION_INIT;
219 break;
219 } 220 }
220 /* set connection as closed */ 221 /* set connection as closed */
221 else 222 else
@@ -227,7 +228,6 @@ MHD_tls_connection_handle_read (struct MHD_Connection *connection)
227 connection->state = MHD_TLS_HANDSHAKE_FAILED; 228 connection->state = MHD_TLS_HANDSHAKE_FAILED;
228 return MHD_NO; 229 return MHD_NO;
229 } 230 }
230 break;
231 } 231 }
232 /* a handshake message has been received out of bound */ 232 /* a handshake message has been received out of bound */
233 else 233 else
@@ -241,7 +241,7 @@ MHD_tls_connection_handle_read (struct MHD_Connection *connection)
241 return MHD_NO; 241 return MHD_NO;
242 } 242 }
243 243
244 /* ignore any out of bound change chiper spec messages */ 244 /* ignore any out of bound change chiper spec messages */
245 case GNUTLS_CHANGE_CIPHER_SPEC: 245 case GNUTLS_CHANGE_CIPHER_SPEC:
246 MHD_tls_connection_close (connection, 246 MHD_tls_connection_close (connection,
247 MHD_TLS_REQUEST_TERMINATED_WITH_ERROR); 247 MHD_TLS_REQUEST_TERMINATED_WITH_ERROR);
@@ -303,9 +303,12 @@ MHD_tls_connection_handle_read (struct MHD_Connection *connection)
303 default: 303 default:
304#if HAVE_MESSAGES 304#if HAVE_MESSAGES
305 MHD_DLOG (connection->daemon, 305 MHD_DLOG (connection->daemon,
306 "Error: unrecognized TLS read message. con-state: %d. l: %d, f: %s\n", 306 "Error: unrecognized TLS message type: %d, connection state: %s. l: %d, f: %s\n",
307 connection->state, __LINE__, __FUNCTION__); 307 msg_type, MHD_state_to_string(connection->state), __LINE__, __FUNCTION__);
308#endif 308#endif
309 /* close connection upon reception of unrecognized message type */
310 MHD_tls_connection_close (connection,
311 MHD_TLS_REQUEST_TERMINATED_WITH_ERROR);
309 return MHD_NO; 312 return MHD_NO;
310 } 313 }
311 314
diff --git a/src/daemon/https/tls/gnutls_buffers.c b/src/daemon/https/tls/gnutls_buffers.c
index 16be8011..5ea95e5f 100644
--- a/src/daemon/https/tls/gnutls_buffers.c
+++ b/src/daemon/https/tls/gnutls_buffers.c
@@ -487,7 +487,6 @@ mhd_gtls_io_read_buffered (mhd_gtls_session_t session, opaque ** iptr,
487 if (sizeOfPtr > MAX_RECV_SIZE || sizeOfPtr == 0) 487 if (sizeOfPtr > MAX_RECV_SIZE || sizeOfPtr == 0)
488 { 488 {
489 gnutls_assert (); /* internal error */ 489 gnutls_assert (); /* internal error */
490 printf("AT %u\n", __LINE__);
491 return GNUTLS_E_INVALID_REQUEST; 490 return GNUTLS_E_INVALID_REQUEST;
492 } 491 }
493 492
@@ -538,7 +537,6 @@ mhd_gtls_io_read_buffered (mhd_gtls_session_t session, opaque ** iptr,
538 > MAX_RECV_SIZE) 537 > MAX_RECV_SIZE)
539 { 538 {
540 gnutls_assert (); /* internal error */ 539 gnutls_assert (); /* internal error */
541 printf("AT %u\n", __LINE__);
542 return GNUTLS_E_INVALID_REQUEST; 540 return GNUTLS_E_INVALID_REQUEST;
543 } 541 }
544 542
@@ -551,14 +549,12 @@ mhd_gtls_io_read_buffered (mhd_gtls_session_t session, opaque ** iptr,
551 if (session->internals.record_recv_buffer.data == NULL) 549 if (session->internals.record_recv_buffer.data == NULL)
552 { 550 {
553 gnutls_assert (); 551 gnutls_assert ();
554 printf("AT %u\n", __LINE__);
555 return GNUTLS_E_MEMORY_ERROR; 552 return GNUTLS_E_MEMORY_ERROR;
556 } 553 }
557 554
558 buf_pos = session->internals.record_recv_buffer.length; 555 buf_pos = session->internals.record_recv_buffer.length;
559 buf = session->internals.record_recv_buffer.data; 556 buf = session->internals.record_recv_buffer.data;
560 *iptr = buf; 557 *iptr = buf;
561 printf("AT %u\n", __LINE__);
562 558
563 /* READ DATA - but leave RCVLOWAT bytes in the kernel buffer. */ 559 /* READ DATA - but leave RCVLOWAT bytes in the kernel buffer. */
564 if (recvdata - recvlowat > 0) 560 if (recvdata - recvlowat > 0)
@@ -570,7 +566,6 @@ mhd_gtls_io_read_buffered (mhd_gtls_session_t session, opaque ** iptr,
570 */ 566 */
571 if (ret < 0 && MHD_gtls_error_is_fatal (ret) == 0) 567 if (ret < 0 && MHD_gtls_error_is_fatal (ret) == 0)
572 { 568 {
573 printf("AT %u\n", __LINE__);
574 return ret; 569 return ret;
575 } 570 }
576 } 571 }
@@ -598,7 +593,6 @@ mhd_gtls_io_read_buffered (mhd_gtls_session_t session, opaque ** iptr,
598 593
599 if (ret2 < 0 && MHD_gtls_error_is_fatal (ret2) == 0) 594 if (ret2 < 0 && MHD_gtls_error_is_fatal (ret2) == 0)
600 { 595 {
601 printf("AT %u\n", __LINE__);
602 return ret2; 596 return ret2;
603 } 597 }
604 598
@@ -618,7 +612,6 @@ mhd_gtls_io_read_buffered (mhd_gtls_session_t session, opaque ** iptr,
618 { 612 {
619 gnutls_assert (); 613 gnutls_assert ();
620 /* that's because they are initialized to 0 */ 614 /* that's because they are initialized to 0 */
621 printf("AT %u\n", __LINE__);
622 return MIN (ret, ret2); 615 return MIN (ret, ret2);
623 } 616 }
624 617
@@ -627,14 +620,12 @@ mhd_gtls_io_read_buffered (mhd_gtls_session_t session, opaque ** iptr,
627 if (ret > 0 && ret < recvlowat) 620 if (ret > 0 && ret < recvlowat)
628 { 621 {
629 gnutls_assert (); 622 gnutls_assert ();
630 printf("AT %u\n", __LINE__);
631 return GNUTLS_E_AGAIN; 623 return GNUTLS_E_AGAIN;
632 } 624 }
633 625
634 if (ret == 0) 626 if (ret == 0)
635 { /* EOF */ 627 { /* EOF */
636 gnutls_assert (); 628 gnutls_assert ();
637 printf("AT %u\n", __LINE__);
638 return 0; 629 return 0;
639 } 630 }
640 631
@@ -644,12 +635,10 @@ mhd_gtls_io_read_buffered (mhd_gtls_session_t session, opaque ** iptr,
644 { 635 {
645 /* Short Read */ 636 /* Short Read */
646 gnutls_assert (); 637 gnutls_assert ();
647 printf("AT %u\n", __LINE__);
648 return GNUTLS_E_AGAIN; 638 return GNUTLS_E_AGAIN;
649 } 639 }
650 else 640 else
651 { 641 {
652 printf("AT %u\n", __LINE__);
653 return ret; 642 return ret;
654 } 643 }
655} 644}
@@ -1234,7 +1223,7 @@ mhd_gtls_handshake_buffer_get_ptr (mhd_gtls_session_t session,
1234 if (length != NULL) 1223 if (length != NULL)
1235 *length = session->internals.handshake_hash_buffer.length; 1224 *length = session->internals.handshake_hash_buffer.length;
1236 1225
1237 _gnutls_buffers_log ("BUF[HSK]: Peeked %d bytes of Data\n", 1226 _gnutls_buffers_log ("BUF[HSK]: Peeked %d bytes of Data\n",
1238 session->internals.handshake_hash_buffer.length); 1227 session->internals.handshake_hash_buffer.length);
1239 1228
1240 if (data_ptr != NULL) 1229 if (data_ptr != NULL)
diff --git a/src/daemon/https/tls/gnutls_str.c b/src/daemon/https/tls/gnutls_str.c
index 4bd09b96..38f04738 100644
--- a/src/daemon/https/tls/gnutls_str.c
+++ b/src/daemon/https/tls/gnutls_str.c
@@ -227,33 +227,6 @@ mhd_gtls_string_append_data (mhd_gtls_string * dest,
227 } 227 }
228} 228}
229 229
230int
231mhd_gtls_string_append_printf (mhd_gtls_string * dest, const char *fmt, ...)
232{
233 va_list args;
234 int len;
235 char *str;
236
237 va_start (args, fmt);
238 len = vsnprintf (NULL, 0, fmt, args);
239 va_end (args);
240 if (len < 0)
241 return -1;
242 str = malloc(len + 1);
243 if (! str)
244 return -1;
245
246 va_start (args, fmt);
247 len = vsprintf (str, fmt, args);
248 va_end (args);
249
250 len = mhd_gtls_string_append_str (dest, str);
251
252 free (str);
253
254 return len;
255}
256
257/* Converts the given string (old) to hex. A buffer must be provided 230/* Converts the given string (old) to hex. A buffer must be provided
258 * to hold the new hex string. The new string will be null terminated. 231 * to hold the new hex string. The new string will be null terminated.
259 * If the buffer does not have enough space to hold the string, a 232 * If the buffer does not have enough space to hold the string, a
diff --git a/src/daemon/https/tls/gnutls_str.h b/src/daemon/https/tls/gnutls_str.h
index 45ad33ae..ead7ba2a 100644
--- a/src/daemon/https/tls/gnutls_str.h
+++ b/src/daemon/https/tls/gnutls_str.h
@@ -55,9 +55,6 @@ int mhd_gtls_string_copy_str (mhd_gtls_string * dest, const char *src);
55int mhd_gtls_string_append_str (mhd_gtls_string *, const char *str); 55int mhd_gtls_string_append_str (mhd_gtls_string *, const char *str);
56int mhd_gtls_string_append_data (mhd_gtls_string *, const void *data, 56int mhd_gtls_string_append_data (mhd_gtls_string *, const void *data,
57 size_t data_size); 57 size_t data_size);
58int mhd_gtls_string_append_printf (mhd_gtls_string * dest, const char *fmt,
59 ...);
60
61char *mhd_gtls_bin2hex (const void *old, size_t oldlen, char *buffer, 58char *mhd_gtls_bin2hex (const void *old, size_t oldlen, char *buffer,
62 size_t buffer_size); 59 size_t buffer_size);
63int mhd_gtls_hex2bin (const opaque * hex_data, int hex_size, 60int mhd_gtls_hex2bin (const opaque * hex_data, int hex_size,
diff --git a/src/daemon/internal.c b/src/daemon/internal.c
index 38fd5771..9d0f3d7d 100644
--- a/src/daemon/internal.c
+++ b/src/daemon/internal.c
@@ -26,7 +26,10 @@
26 26
27#include "internal.h" 27#include "internal.h"
28 28
29#if DEBUG_STATES 29#if HAVE_MESSAGES
30/**
31 * State to string dictionary.
32 */
30char * 33char *
31MHD_state_to_string (enum MHD_CONNECTION_STATE state) 34MHD_state_to_string (enum MHD_CONNECTION_STATE state)
32{ 35{
@@ -80,8 +83,9 @@ MHD_state_to_string (enum MHD_CONNECTION_STATE state)
80 return "secure handshake failed"; 83 return "secure handshake failed";
81 case MHD_TLS_HANDSHAKE_COMPLETE: 84 case MHD_TLS_HANDSHAKE_COMPLETE:
82 return "secure handshake _complete"; 85 return "secure handshake _complete";
86 default:
87 return "unrecognized connection state";
83 } 88 }
84 return "unrecognized connection state";
85} 89}
86#endif 90#endif
87 91
diff --git a/src/daemon/internal.h b/src/daemon/internal.h
index 76c17dbc..39886187 100644
--- a/src/daemon/internal.h
+++ b/src/daemon/internal.h
@@ -301,7 +301,7 @@ enum MHD_CONNECTION_STATE
301 */ 301 */
302#define DEBUG_STATES MHD_NO 302#define DEBUG_STATES MHD_NO
303 303
304#if DEBUG_STATES 304#if HAVE_MESSAGES
305char *MHD_state_to_string (enum MHD_CONNECTION_STATE state); 305char *MHD_state_to_string (enum MHD_CONNECTION_STATE state);
306#endif 306#endif
307 307
@@ -568,7 +568,7 @@ struct MHD_Connection
568 ReceiveCallback recv_cls; 568 ReceiveCallback recv_cls;
569 569
570 TransmitCallback send_cls; 570 TransmitCallback send_cls;
571 571
572#if HTTPS_SUPPORT 572#if HTTPS_SUPPORT
573 /* TODO rename as this might be an SSL connection */ 573 /* TODO rename as this might be an SSL connection */
574 mhd_gtls_session_t tls_session; 574 mhd_gtls_session_t tls_session;
diff --git a/src/examples/Makefile.am b/src/examples/Makefile.am
index bd25184d..a06f7e1f 100644
--- a/src/examples/Makefile.am
+++ b/src/examples/Makefile.am
@@ -14,7 +14,7 @@ fileserver_example_external_select \
14refuse_post_example 14refuse_post_example
15 15
16if ENABLE_HTTPS 16if ENABLE_HTTPS
17noinst_PROGRAMS += https_server_example 17noinst_PROGRAMS += https_fileserver_example
18endif 18endif
19 19
20minimal_example_SOURCES = \ 20minimal_example_SOURCES = \
@@ -47,7 +47,7 @@ fileserver_example_external_select_SOURCES = \
47fileserver_example_external_select_LDADD = \ 47fileserver_example_external_select_LDADD = \
48 $(top_builddir)/src/daemon/libmicrohttpd.la 48 $(top_builddir)/src/daemon/libmicrohttpd.la
49 49
50https_server_example_SOURCES = \ 50https_fileserver_example_SOURCES = \
51https_server_example.c 51https_fileserver_example.c
52https_server_example_LDADD = \ 52https_fileserver_example_LDADD = \
53 $(top_builddir)/src/daemon/libmicrohttpd.la 53 $(top_builddir)/src/daemon/libmicrohttpd.la
diff --git a/src/examples/https_server_example.c b/src/examples/https_fileserver_example.c
index 06d82a52..55201ce2 100644
--- a/src/examples/https_server_example.c
+++ b/src/examples/https_fileserver_example.c
@@ -20,16 +20,14 @@
20 * @file https_server_example.c 20 * @file https_server_example.c
21 * @brief a simple HTTPS file server using TLS. 21 * @brief a simple HTTPS file server using TLS.
22 * 22 *
23 * Server may be supplied either with included hard coded certificates or using 23 * Usage :
24 * external ones, which are to be supplied through command line arguments.
25 * A private key file named "key.pem" and a server certificate file named "cert.pem".
26 * are necessary to run the server in this way.
27 * 24 *
28 * 'certtool' may be used to generate these if required. 25 * 'http_fileserver_example HTTP-PORT SECONDS-TO-RUN [CERTIFICATE PATH, KEY PATH]'
29 * 26 *
30 * Access server with your browser of choice or with curl : 27 * The certificate & key are required by the server to operate, Omitting the
28 * path arguments will cause the server to use the hard coded example certificate & key.
31 * 29 *
32 * curl --insecure --tlsv1 --ciphers AES256-SHA <url> 30 * 'certtool' may be used to generate these if required.
33 * 31 *
34 * @author Sagie Amir 32 * @author Sagie Amir
35 */ 33 */
@@ -159,31 +157,43 @@ main (int argc, char *const *argv)
159{ 157{
160 struct MHD_Daemon *TLS_daemon; 158 struct MHD_Daemon *TLS_daemon;
161 159
162 /* look for HTTPS arguments */ 160 if (argc == 3){
163 if (argc < 5)
164 {
165 printf
166 ("Usage : %s HTTP-PORT SECONDS-TO-RUN KEY-FILE CERT-FILE\n", argv[0]);
167 return 1;
168 }
169
170 /* TODO check if this is truly necessary - disallow usage of the blocking /dev/random */ 161 /* TODO check if this is truly necessary - disallow usage of the blocking /dev/random */
171 /* gcry_control(GCRYCTL_ENABLE_QUICK_RANDOM, 0); */ 162 /* gcry_control(GCRYCTL_ENABLE_QUICK_RANDOM, 0); */
172
173 TLS_daemon = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_DEBUG 163 TLS_daemon = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_DEBUG
174 | MHD_USE_SSL, atoi (argv[3]), 164 | MHD_USE_SSL, atoi (argv[1]),
175 NULL, 165 NULL,
176 NULL, &http_ahc, 166 NULL, &http_ahc,
177 NULL, MHD_OPTION_CONNECTION_TIMEOUT, 256, 167 NULL, MHD_OPTION_CONNECTION_TIMEOUT, 256,
178 MHD_OPTION_HTTPS_MEM_KEY, key_pem, 168 MHD_OPTION_HTTPS_MEM_KEY, key_pem,
179 MHD_OPTION_HTTPS_MEM_CERT, cert_pem, 169 MHD_OPTION_HTTPS_MEM_CERT, cert_pem,
170
180 MHD_OPTION_END); 171 MHD_OPTION_END);
172 }
173 else if (argc == 5){
174 TLS_daemon = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_DEBUG
175 | MHD_USE_SSL, atoi (argv[1]),
176 NULL,
177 NULL, &http_ahc,
178 NULL, MHD_OPTION_CONNECTION_TIMEOUT, 256,
179 MHD_OPTION_HTTPS_CERT_PATH, argv[3],
180 MHD_OPTION_HTTPS_KEY_PATH, argv[4],
181 MHD_OPTION_END);
182 }
183 else {
184 printf
185 ("Usage : %s HTTP-PORT SECONDS-TO-RUN [CERTIFICATE PATH, KEY PATH]\n", argv[0]);
186 return 1;
187 }
181 188
182 if (TLS_daemon == NULL) 189 if (TLS_daemon == NULL)
183 { 190 {
184 printf ("Error: failed to start TLS_daemon"); 191 printf ("Error: failed to start TLS_daemon");
185 return 1; 192 return 1;
186 } 193 }
194 else {
195 printf ("MHD daemon listening on port %d\n", atoi (argv[1]));
196 }
187 197
188 sleep (atoi (argv[2])); 198 sleep (atoi (argv[2]));
189 199
diff --git a/src/testcurl/https/tls_daemon_options_test.c b/src/testcurl/https/tls_daemon_options_test.c
index 556d6684..412f65f2 100644
--- a/src/testcurl/https/tls_daemon_options_test.c
+++ b/src/testcurl/https/tls_daemon_options_test.c
@@ -403,6 +403,7 @@ main (int argc, char *const *argv)
403{ 403{
404 FILE *test_fd; 404 FILE *test_fd;
405 unsigned int errorCount = 0; 405 unsigned int errorCount = 0;
406 char * cur_dir;
406 407
407 MHD_gtls_global_set_log_level (DEBUG_GNUTLS_LOG_LEVEL); 408 MHD_gtls_global_set_log_level (DEBUG_GNUTLS_LOG_LEVEL);
408 409
@@ -434,11 +435,14 @@ main (int argc, char *const *argv)
434 MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem, 435 MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem,
435 MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem, 436 MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem,
436 MHD_OPTION_END); 437 MHD_OPTION_END);
438
439 cur_dir = get_current_dir_name ();
437 errorCount += 440 errorCount +=
438 test_wrap ("file certificates", &test_file_certificates, test_fd, 441 test_wrap ("file certificates", &test_file_certificates, test_fd,
439 "AES256-SHA", CURL_SSLVERSION_TLSv1, MHD_OPTION_HTTPS_MEM_KEY, 442 "AES256-SHA", CURL_SSLVERSION_TLSv1, MHD_OPTION_HTTPS_CERT_PATH, cur_dir,
440 srv_key_pem, MHD_OPTION_HTTPS_MEM_CERT, 443 MHD_OPTION_HTTPS_KEY_PATH, cur_dir, MHD_OPTION_END);
441 srv_self_signed_cert_pem, MHD_OPTION_END); 444 free (cur_dir);
445
442 errorCount += 446 errorCount +=
443 test_wrap ("protocol_version", &test_protocol_version, test_fd, 447 test_wrap ("protocol_version", &test_protocol_version, test_fd,
444 "AES256-SHA", CURL_SSLVERSION_TLSv1, MHD_OPTION_HTTPS_MEM_KEY, 448 "AES256-SHA", CURL_SSLVERSION_TLSv1, MHD_OPTION_HTTPS_MEM_KEY,
diff --git a/src/testcurl/https/tls_session_time_out_test.c b/src/testcurl/https/tls_session_time_out_test.c
index 37d28656..f0f43dbc 100644
--- a/src/testcurl/https/tls_session_time_out_test.c
+++ b/src/testcurl/https/tls_session_time_out_test.c
@@ -156,7 +156,6 @@ main (int argc, char *const *argv)
156 MHD_USE_DEBUG, 42433, 156 MHD_USE_DEBUG, 42433,
157 NULL, NULL, &http_ahc, NULL, 157 NULL, NULL, &http_ahc, NULL,
158 MHD_OPTION_CONNECTION_TIMEOUT, TIME_OUT, 158 MHD_OPTION_CONNECTION_TIMEOUT, TIME_OUT,
159 MHD_OPTION_SOCK_ADDR, "127.0.0.1",
160 MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem, 159 MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem,
161 MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem, 160 MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem,
162 MHD_OPTION_END); 161 MHD_OPTION_END);