CURL and HTTPS, “Cannot resolve host”

前端 未结 11 1980
时光取名叫无心
时光取名叫无心 2020-11-28 08:25

I\'m trying to fetch the contents of a page using CURL. The page that is doing the fetching is https and the page it is trying to fetch is also https. I\'m getting an erro

11条回答
  •  臣服心动
    2020-11-28 09:02

    After tried all above, still can't resolved my issue yet. But got new solution for my problem.

    At server where you are going to make a request, there should be a entry of your virtual host.

    sudo vim /etc/hosts
    

    and insert

    192.xxx.x.xx www.domain.com

    The reason if you are making request from server to itself then, to resolve your virtual host or to identify it, server would need above stuff, otherwise server won't understand your requesting(origin) host.

提交回复
热议问题