angular and self-signed SSL cert - ERR_INSECURE_RE

2019-06-16 09:09发布

I have a need to connect my angular $resources to a self-signed https web api. If I try to do that directly, I have messages such as

OPTIONS https://address/api/authentication net::ERR_INSECURE_RESPONSE

Is there a way to overcome this error, by any means specifying that this particular connection is trusted?

标签: angularjs ssl
2条回答
叼着烟拽天下
2楼-- · 2019-06-16 09:30

This does not really overcome the problem, but is a suitable workaround if you do web UX development and just need to see your changes in the browser in a dev env:

Whatever the backend api URL is that angular is calling, just open another tab to that URL and accept the invalid certificate warning in the browser. After this the app will work against the invalid certificate until you close the browser.

Tested in IE and Chrome.

查看更多
Ridiculous、
3楼-- · 2019-06-16 09:51

Unfortunately it won't work unless you're running your frontend on the same origin as the web api.

AJAX calls to untrusted (self-signed) HTTPS fail silently

查看更多
登录 后发表回答