diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/testcurl/https/test_https_get.c | 55 |
2 files changed, 4 insertions, 56 deletions
@@ -1,4 +1,7 @@ | |||
1 | Mon Nov 04 15:43:00 MSK 2017 | 1 | Mon Dec 07 16:01:00 MSK 2017 |
2 | Fixed HTTPS tests on modern platforms. -EG | ||
3 | |||
4 | Mon Dec 04 15:43:00 MSK 2017 | ||
2 | Minor documentation installation fixes. -EG | 5 | Minor documentation installation fixes. -EG |
3 | 6 | ||
4 | Mon Nov 27 22:58:38 CET 2017 | 7 | Mon Nov 27 22:58:38 CET 2017 |
diff --git a/src/testcurl/https/test_https_get.c b/src/testcurl/https/test_https_get.c index 8ed0028a..61c25643 100644 --- a/src/testcurl/https/test_https_get.c +++ b/src/testcurl/https/test_https_get.c | |||
@@ -34,54 +34,9 @@ | |||
34 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ | 34 | #endif /* MHD_HTTPS_REQUIRE_GRYPT */ |
35 | #include "tls_test_common.h" | 35 | #include "tls_test_common.h" |
36 | 36 | ||
37 | extern const char srv_key_pem[]; | ||
38 | extern const char srv_self_signed_cert_pem[]; | ||
39 | extern const char srv_signed_cert_pem[]; | 37 | extern const char srv_signed_cert_pem[]; |
40 | extern const char srv_signed_key_pem[]; | 38 | extern const char srv_signed_key_pem[]; |
41 | 39 | ||
42 | |||
43 | static int | ||
44 | test_cipher_option (FILE * test_fd, | ||
45 | const char *cipher_suite, | ||
46 | int proto_version) | ||
47 | { | ||
48 | int ret; | ||
49 | struct MHD_Daemon *d; | ||
50 | int port; | ||
51 | |||
52 | if (MHD_NO != MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT)) | ||
53 | port = 0; | ||
54 | else | ||
55 | port = 3040; | ||
56 | |||
57 | d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS | | ||
58 | MHD_USE_ERROR_LOG, port, | ||
59 | NULL, NULL, &http_ahc, NULL, | ||
60 | MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem, | ||
61 | MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem, | ||
62 | MHD_OPTION_END); | ||
63 | |||
64 | if (d == NULL) | ||
65 | { | ||
66 | fprintf (stderr, MHD_E_SERVER_INIT); | ||
67 | return -1; | ||
68 | } | ||
69 | if (0 == port) | ||
70 | { | ||
71 | const union MHD_DaemonInfo *dinfo; | ||
72 | dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT); | ||
73 | if (NULL == dinfo || 0 == dinfo->port) | ||
74 | { MHD_stop_daemon (d); return -1; } | ||
75 | port = (int)dinfo->port; | ||
76 | } | ||
77 | |||
78 | ret = test_https_transfer (test_fd, port, cipher_suite, proto_version); | ||
79 | |||
80 | MHD_stop_daemon (d); | ||
81 | return ret; | ||
82 | } | ||
83 | |||
84 | |||
85 | /* perform a HTTP GET request via SSL/TLS */ | 40 | /* perform a HTTP GET request via SSL/TLS */ |
86 | static int | 41 | static int |
87 | test_secure_get (FILE * test_fd, | 42 | test_secure_get (FILE * test_fd, |
@@ -130,7 +85,6 @@ main (int argc, char *const *argv) | |||
130 | { | 85 | { |
131 | unsigned int errorCount = 0; | 86 | unsigned int errorCount = 0; |
132 | const char *aes256_sha_tlsv1 = "AES256-SHA"; | 87 | const char *aes256_sha_tlsv1 = "AES256-SHA"; |
133 | const char *des_cbc3_sha_tlsv1 = "DES-CBC3-SHA"; | ||
134 | (void)argc; /* Unused. Silent compiler warning. */ | 88 | (void)argc; /* Unused. Silent compiler warning. */ |
135 | 89 | ||
136 | #ifdef MHD_HTTPS_REQUIRE_GRYPT | 90 | #ifdef MHD_HTTPS_REQUIRE_GRYPT |
@@ -151,19 +105,10 @@ main (int argc, char *const *argv) | |||
151 | if (curl_uses_nss_ssl() == 0) | 105 | if (curl_uses_nss_ssl() == 0) |
152 | { | 106 | { |
153 | aes256_sha_tlsv1 = "rsa_aes_256_sha"; | 107 | aes256_sha_tlsv1 = "rsa_aes_256_sha"; |
154 | des_cbc3_sha_tlsv1 = "rsa_aes_128_sha"; | ||
155 | } | 108 | } |
156 | 109 | ||
157 | errorCount += | 110 | errorCount += |
158 | test_secure_get (NULL, aes256_sha_tlsv1, CURL_SSLVERSION_TLSv1); | 111 | test_secure_get (NULL, aes256_sha_tlsv1, CURL_SSLVERSION_TLSv1); |
159 | #if GNUTLS_VERSION_NUMBER < 0x030600 | ||
160 | /* '3DES' is disabled by default on GnuTLS > 3.6.0 */ | ||
161 | errorCount += | ||
162 | test_cipher_option (NULL, des_cbc3_sha_tlsv1, CURL_SSLVERSION_TLSv1); | ||
163 | #else /* GNUTLS_VERSION_NUMBER >= 0x030600 */ | ||
164 | (void)des_cbc3_sha_tlsv1; | ||
165 | (void)test_cipher_option; | ||
166 | #endif /* GNUTLS_VERSION_NUMBER >= 0x030600 */ | ||
167 | print_test_result (errorCount, argv[0]); | 112 | print_test_result (errorCount, argv[0]); |
168 | 113 | ||
169 | curl_global_cleanup (); | 114 | curl_global_cleanup (); |