2

I'm trying to curl an API server using command substitution but it seems that I'm missing something in my bash command.

test@macos:~$ echo $APISERVER
https://192.168.99.101:8443

test@macos:~$ curl -g "$APISERVER"
curl: (6) Could not resolve host: https

What I'm trying to achieve is this:

test@macos:~$ curl -g https://192.168.99.101:8443
curl: (60) SSL certificate problem: unable to get local issuer certificate

Here are some additional info that may be helpful:

test@macos:~$ curl --version
curl 7.54.0 (x86_64-apple-darwin18.0)
test@macos:~$ echo $BASH_VERSION
5.0.11(1)-release
kroebuleux
  • 41
  • 2
  • Actuallу, problem not in bash variable. Possibly duplicate [curl: (60) SSL certificate : unable to get local issuer certificate](https://stackoverflow.com/questions/24611640/curl-60-ssl-certificate-unable-to-get-local-issuer-certificate) – Alexander Yancharuk Oct 28 '19 at 04:35
  • Why are you using `-g`? Have you tried `-v` to see more detail? Have you tried without quotes? – Don't Panic Oct 28 '19 at 07:28
  • This is note a duplicate question. The OP was asking about this error `curl: (6) Could not resolve host: https` and NOT the certificate problem. I ran into the same issue and I had an extra set of double quotes in the URL. Try: `curl -g $APISERVER` (without the double quotes) – Ngoan Nguyen Nov 13 '19 at 21:33

0 Answers0