[ARVADOS] created: 1.1.4-320-gcdd57a7

Git user git at public.curoverse.com
Wed May 30 16:05:16 EDT 2018


        at  cdd57a73f2f90d6b14b8652ab94adc14e4b99c8b (commit)


commit cdd57a73f2f90d6b14b8652ab94adc14e4b99c8b
Author: Ward Vandewege <wvandewege at veritasgenetics.com>
Date:   Wed May 30 16:03:59 2018 -0400

    13547: make the Python SDK respect the ARVADOS_API_HOST_INSECURE environment
    variable when speaking with keep over SSL
    
    refs #13547
    
    Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <wvandewege at veritasgenetics.com>

diff --git a/sdk/python/arvados/keep.py b/sdk/python/arvados/keep.py
index e8e95af..1150bb6 100644
--- a/sdk/python/arvados/keep.py
+++ b/sdk/python/arvados/keep.py
@@ -371,6 +371,8 @@ class KeepClient(object):
                         '{}: {}'.format(k,v) for k,v in self.get_headers.items()])
                     curl.setopt(pycurl.WRITEFUNCTION, response_body.write)
                     curl.setopt(pycurl.HEADERFUNCTION, self._headerfunction)
+                    if self.insecure:
+                        curl.setopt(pycurl.SSL_VERIFYPEER, 0)
                     if method == "HEAD":
                         curl.setopt(pycurl.NOBODY, True)
                     self._setcurltimeouts(curl, timeout)
@@ -463,6 +465,8 @@ class KeepClient(object):
                         '{}: {}'.format(k,v) for k,v in self.put_headers.items()])
                     curl.setopt(pycurl.WRITEFUNCTION, response_body.write)
                     curl.setopt(pycurl.HEADERFUNCTION, self._headerfunction)
+                    if self.insecure:
+                        curl.setopt(pycurl.SSL_VERIFYPEER, 0)
                     self._setcurltimeouts(curl, timeout)
                     try:
                         curl.perform()
@@ -762,6 +766,11 @@ class KeepClient(object):
         if local_store is None:
             local_store = os.environ.get('KEEP_LOCAL_STORE')
 
+        if config.flag_is_true('ARVADOS_API_HOST_INSECURE'):
+            self.insecure = True
+        else:
+            self.insecure = False
+
         self.block_cache = block_cache if block_cache else KeepBlockCache()
         self.timeout = timeout
         self.proxy_timeout = proxy_timeout

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list