浏览代码

Unit test: Don't connect to external HTTPS server on Travis OSX test

On Travis CI worker images with OSX / MacOS, it seems to be impossible
to open an HTTPS connection to an external server. A (non encrypted)
HTTP connection to the same server works. The HTTPS connection to the
same server works from Travis CI worker images with (Ubuntu) Linux.
The connection is also possible from AppVeyor CI Windows worker images.
It seems OpenSSL 1.1 works on OSX/Travis, but 1.0 does not.
bel2125 7 年之前
父节点
当前提交
b419b610e6
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      unittest/public_server.c

+ 7 - 1
unittest/public_server.c

@@ -4612,7 +4612,11 @@ START_TEST(test_minimal_tls_client)
 {
 	mark_point();
 
-#if !defined(NO_SSL)
+#if !defined(NO_SSL) /* dont run https test if SSL is not enabled */
+
+#if (!defined(__MACH__) || defined(LOCAL_TEST)) && !defined(OPENSSL_API_1_1)
+	/* dont run on Travis OSX worker with OpenSSL 1.0 */
+
 	/* Initialize the library */
 	mg_init_library(2);
 
@@ -4627,6 +4631,8 @@ START_TEST(test_minimal_tls_client)
 
 	/* Un-initialize the library */
 	mg_exit_library();
+
+#endif
 #endif
 
 	mark_point();