简体   繁体   English

来自 jQuery 的 ERR_CERT_COMMON_NAME_INVALID 使用反向代理

[英]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.abcapi.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 Namewww.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.

相关问题 为什么我在jQuery中收到ERR_CERT_COMMON_NAME_INVALID错误? - Why i'm getting ERR_CERT_COMMON_NAME_INVALID error in jQuery? 使用提取API向Metaweather API发出请求时出现net :: ERR_CERT_COMMON_NAME_INVALID错误 - net::ERR_CERT_COMMON_NAME_INVALID error while using fetch API to make request to metaweather API 使用 XMLHttpRequest 时为我的故障 URL 获取 ERR_CERT_COMMON_NAME_INVALID? - Getting ERR_CERT_COMMON_NAME_INVALID for my glitch URL when using XMLHttpRequest? 导入命令导致错误“net::ERR_CERT_COMMON_NAME_INVALID” - Import command causes error "net::ERR_CERT_COMMON_NAME_INVALID" 无法通过 ERR_CERT_COMMON_NAME_INVALID 在 CodeSandbox.io 上获取 API? - Failed to fetch API on CodeSandbox.io with ERR_CERT_COMMON_NAME_INVALID? NodeJS Express 反向代理 TLS_CERT_ALTNAME_INVALID 错误 - NodeJS Express reverse proxy TLS_CERT_ALTNAME_INVALID error 如何从提供 NET::ERR_CERT_AUTHORITY_INVALID 的站点获取数据 - how to fetch data from a site which gives NET::ERR_CERT_AUTHORITY_INVALID 由于“ERR_CERT_DATE_INVALID”,与 websocket 的连接失败 - Connection to websocket has failed due to “ERR_CERT_DATE_INVALID” 如何在 javascript 中捕获 ERR_CERT_AUTHORITY_INVALID - How to catch ERR_CERT_AUTHORITY_INVALID in javascript Apollo Explorer 加载资源失败:net::ERR_CERT_AUTHORITY_INVALID - Apollo Explorer Failed to load resource: net::ERR_CERT_AUTHORITY_INVALID
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM