changeset 24289:07fafcd4bc74

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.
author Yuya Nishihara <yuya@tcha.org>
date Wed, 04 Mar 2015 22:41:48 +0900
parents 922e087ba158
children b76d8c641746
files tests/hghave.py tests/test-https.t
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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]