Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/433.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript net::ERR_CERT_COMMON_NAME_使用fetch API向metaweather API发出请求时出现无效错误_Javascript_Reactjs_Ssl_Ssl Certificate_Fetch - Fatal编程技术网

Javascript net::ERR_CERT_COMMON_NAME_使用fetch API向metaweather API发出请求时出现无效错误

Javascript net::ERR_CERT_COMMON_NAME_使用fetch API向metaweather API发出请求时出现无效错误,javascript,reactjs,ssl,ssl-certificate,fetch,Javascript,Reactjs,Ssl,Ssl Certificate,Fetch,我正在向metaweather.com API发出GET请求,并在控制台中收到此错误: GET net::ERR\u CERT\u COMMON\u NAME\u无效 当我把这个URL粘贴到我的浏览器上时,它说连接是不安全的,有相同的错误代码 我该如何解决这个问题 代码是这样的,没有什么特别之处: fetch(query) .then(function(response) {console.log(2)}) .catch(() => {console.log(3)});

我正在向metaweather.com API发出GET请求,并在控制台中收到此错误: GET net::ERR\u CERT\u COMMON\u NAME\u无效

当我把这个URL粘贴到我的浏览器上时,它说连接是不安全的,有相同的错误代码

我该如何解决这个问题

代码是这样的,没有什么特别之处:

fetch(query)
    .then(function(response) {console.log(2)})
    .catch(() => {console.log(3)});

看起来应该可以访问
www.metaweather.com
,而不仅仅是
metaweather.com
。第一个证书提供与URL中的名称匹配的正确证书,而最后一个证书不提供。它会返回一个证书,用于
重定向.pointhq.com

使用不同的天气API。。。没有短缺。。。