[英]ERR_CERT_COMMON_NAME_INVALID from jQuery Using Reverse Proxy
I am having an issue with 'ERR_CERT_COMMON_NAME_INVALID' when making a request from a website.从网站发出请求时,我遇到了“ERR_CERT_COMMON_NAME_INVALID”问题。
First of all, am really a bit of a novice when it comes to setting up and using certs... so this is probably something stupid that I have ether done or not done!首先,在设置和使用证书方面,我真的有点新手......所以这可能是一些愚蠢的事情,我已经完成或没有完成!
I have a ssl certificate www.my-dummy-url.abc
and api.my-dummy-url.abc
(obviously my-dummy-url
is for example only).我有一个 ssl 证书
www.my-dummy-url.abc
和api.my-dummy-url.abc
(显然my-dummy-url
仅作为示例)。 Where api.my-dummy-url.abc
is the certificate Subject Alternative Name
and www.my-dummy-url.abc
is the certificate Subject
.其中
api.my-dummy-url.abc
是证书Subject Alternative Name
和www.my-dummy-url.abc
是证书Subject
。
The Apache Web sever, is hosted at www.my-dummy-url.abc
, whilst a reverse proxy points ' api.my-dummy-url.abc
to a Raspberry Pi running a little node.js API endpoint (/weather). The Apache Web sever, is hosted at
www.my-dummy-url.abc
, whilst a reverse proxy points ' api.my-dummy-url.abc
to a Raspberry Pi running a little node.js API endpoint (/weather).
I have set node.js up to use express: https.createServer(ssl_options, ...
, where ssl_options
is my cert.pem and key.pem. CORS is enabled ( app.use(cors());
) and 'Access-Control-Allow-Origin', '*'
is present in the response. I have set node.js up to use express:
https.createServer(ssl_options, ...
, where ssl_options
is my cert.pem and key.pem. CORS is enabled ( app.use(cors());
) and 'Access-Control-Allow-Origin', '*'
出现在响应中。
The Website (apart from the API call) renders fine at https://www.my-dummy-url.abc (Chrome).该网站(除 API 调用外)在https://www.my-dummy-url.abc (Chrome) 处呈现良好。 The API, ( https://api.my-dummy-url.abc/weather ) if requested within the address bar of a Chrome browser or through Postman receives the correct JSON response.
The API, ( https://api.my-dummy-url.abc/weather ) if requested within the address bar of a Chrome browser or through Postman receives the correct JSON response.
However, from my website as a jQuery $.get
function I get the following error:但是,从我的网站 jQuery
$.get
function 我收到以下错误:
GET https://api.my-dummy-url.abc/weather net::ERR_CERT_COMMON_NAME_INVALID
Any ideas, helpers, pointer or solutions will be gratefully received...任何想法,帮助者,指针或解决方案将不胜感激......
As an addition, if I use Edge rather then Chrome, it works...!另外,如果我使用 Edge 而不是 Chrome,它可以工作......!
Kind Regards, Harold Clements亲切的问候,哈罗德克莱门茨
This issue was that Chrome was caching the certificate somehow.这个问题是 Chrome 以某种方式缓存了证书。 After shutting down and coming back to it the next day, it was working fine.
关闭并在第二天恢复后,它工作正常。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.