Curl Couldn't resolve host for HTTPS

24,681

The problem was OK after configuring proxy for HTTPS as follows.

export https_proxy=http://proxy:8080/
Share:
24,681

Related videos on Youtube

Indika K
Author by

Indika K

Updated on September 18, 2022

Comments

  • Indika K
    Indika K over 1 year

    I am trying to use curl on a Red Hat Enterprise Linux Server release 6.1. When I try to use URL with HTTPS it gives an error message "Couldn't resolve host". But for the same URL when tried with HTTP (http://www.google.lk) response is successful.

    [root@localhost /]# curl --proxy-user username:password -L -i https://www.google.lk
    curl: (6) Couldn't resolve host 'www.google.lk'
    [root@localhost /]#
    

    Can there be anything wrong with my SSL configuration here. Any help is greatly appreciated...

    • Anders
      Anders almost 12 years
      I don't think that you got any problems with SSL/TSL. Have you tried 'getent hosts www.google.lk' ? Does the site redirect your web browser to another site when you use https compared with http? What dns-servers do you use, do they give the right answers? I do think that you have problems with DNS or generally, name resolvment. Could be that and a combination wit redirect of website to different servers depending on http or https.
    • SuperSafie
      SuperSafie almost 12 years
      Do you have to use a proxy both for HTTP and HTTPS? How are you configuring the proxy? It looks like curl is only using the proxy for HTTP requests...
    • Indika K
      Indika K almost 12 years
      Thank you... Guided by your comments I found the solution.