Skip to contentSkip to conversation

honor the http.sslVerify option in shell scripts

PATCH New Aurelien Bompard 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 honor the http.sslVerify option in shell scripts

---
 git-clone.sh     |    3 ++-
 git-ls-remote.sh |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
git-clone.sh +2 -1
index 5e582fe..3bb683d 100755
@@ -28,7 +28,8 @@ get_repo_base() {
        ) 2>/dev/null
 }
 
-if [ -n "$GIT_SSL_NO_VERIFY" ]; then
+if [ -n "$GIT_SSL_NO_VERIFY" -o \
+    "`git config --bool http.sslVerify`" = false ]; then
     curl_extra_args="-k"
 fi
 
git-ls-remote.sh +2 -1
index d56cf92..3eb18d1 100755
@@ -54,7 +54,8 @@ tmpdir=$tmp-d
 
 case "$peek_repo" in
 http://* | https://* | ftp://* )
-        if [ -n "$GIT_SSL_NO_VERIFY" ]; then
+        if [ -n "$GIT_SSL_NO_VERIFY" -o \
+            "`git config --bool http.sslVerify`" = false ]; then
             curl_extra_args="-k"
         fi
        if [ -n "$GIT_CURL_FTP_NO_EPSV" -o \

--
1.5.3.3