test-https: enable dummycert test only if Apple python is used (issue4500)
authorYuya Nishihara <yuya@tcha.org>
Wed, 04 Mar 2015 22:41:48 +0900
changeset 24289 07fafcd4bc74
parent 24288 922e087ba158
child 24290 b76d8c641746
test-https: enable dummycert test only if Apple python is used (issue4500) The dummycert trick works only if Python is linked to Apple's patched OpenSSL.
tests/hghave.py
tests/test-https.t
--- a/tests/hghave.py	Wed Mar 04 22:27:01 2015 +0900
+++ b/tests/hghave.py	Wed Mar 04 22:41:48 2015 +0900
@@ -320,6 +320,11 @@
     except ImportError:
         return False
 
+@check("defaultcacerts", "can verify SSL certs by system's CA certs store")
+def has_defaultcacerts():
+    from mercurial import sslutil
+    return sslutil._defaultcacerts()
+
 @check("windows", "Windows")
 def has_windows():
     return os.name == 'nt'
--- a/tests/test-https.t	Wed Mar 04 22:27:01 2015 +0900
+++ b/tests/test-https.t	Wed Mar 04 22:41:48 2015 +0900
@@ -119,7 +119,7 @@
 Apple's OpenSSL. This trick do not work with plain OpenSSL.
 
   $ DISABLEOSXDUMMYCERT=
-#if osx
+#if defaultcacerts
   $ hg clone https://localhost:$HGPORT/ copy-pull
   abort: error: *certificate verify failed* (glob)
   [255]