osx-ssl-certs-curl 812 B

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/env bash
  2. __rvm_osx_ssl_certs_curl_cert_find_path()
  3. {
  4. # Find correct curl CA Bundle path
  5. # See: https://curl.haxx.se/docs/sslcerts.html
  6. \typeset osx_ssl_certs_curl_ca_bundle
  7. osx_ssl_certs_curl_ca_bundle="$CURL_CA_BUNDLE"
  8. if [[ ! -f "$osx_ssl_certs_curl_ca_bundle" ]]
  9. then
  10. \typeset curl_bin
  11. curl_bin="$(type -p curl)"
  12. osx_ssl_certs_curl_ca_bundle="${curl_bin%/bin/curl}/share/curl/curl-ca-bundle.crt"
  13. fi
  14. rvm_debug "Expected cURL certificate bundle location: ${osx_ssl_certs_curl_ca_bundle}"
  15. if [[ -f "$osx_ssl_certs_curl_ca_bundle" ]]
  16. then
  17. rvm_debug "Found cURL certificate bundle ${osx_ssl_certs_curl_ca_bundle}"
  18. echo $osx_ssl_certs_curl_ca_bundle
  19. else
  20. rvm_warn "cURL certificate bundle ${osx_ssl_certs_curl_ca_bundle} not found"
  21. echo ""
  22. fi
  23. }