CORS request did not succeed on Firefox but works on Chrome

我只是一个虾纸丫 提交于 2019-12-07 05:31:42

问题


I'm making CORS requests from https://169.254.128.2:8443 to APIs served on https://169.254.128.2:8444 by lighttpd server. Lighttpd has CORS enabled with the following response headers but the OPTIONS request does not go through on Firefox.

setenv.add-response-header = (
    "Access-Control-Allow-Origin" => "*" (tried https://169.254.128.2:8443 too),
    "Access-Control-Allow-Headers" => "accept, origin, x-requested-with, content-type, x-transmission-session-id, x-ida-auth-token, content-disposition",
    "Access-Control-Expose-Headers" => "X-Transmission-Session-Id",
    "Access-Control-Allow-Methods" => "GET, POST, OPTIONS, PUT"
    )

I get the error: MOZILLA_PKIX_ERROR_SELF_SIGNED_CERT. I'd like to know if there is a way to communicate with 8444 other than explicitly accepting the certificate for 8444. I already accept the certificate for 8443 when I first access the url https://169.254.128.2:8443 and 8444 and 8443 use the same certificates. The requests go through fine on both Chrome and Safari without accepting certificates.


回答1:


This is a firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=700837

You must enable the certificate on each port indivually.

Open url in firefox and aceept certificates https://169.254.128.2:8443

https://169.254.128.2:8444



来源:https://stackoverflow.com/questions/51831652/cors-request-did-not-succeed-on-firefox-but-works-on-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!