跨端口的CORS请求在Firefox上未成功,但在Chrome上有效 [英] CORS request across different ports did not succeed on Firefox but works on Chrome

查看:133
本文介绍了跨端口的CORS请求在Firefox上未成功,但在Chrome上有效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从 https://169.254.128.2:8443 向lighttpd服务器在 https://169.254.128.2:8444 服务的API发出CORS请求.Lighttpd启用了带有以下响应标头的CORS,但OPTIONS请求未在Firefox上通过.

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"
    )

我收到错误:MOZILLA_PKIX_ERROR_SELF_SIGNED_CERT.我想知道是否有一种与8444通信的方法,而不是明确接受8444的证书.当我第一次访问url https://169.254.128.2:8443 <时,我已经接受了8443的证书./code>以及8444和8443使用相同的证书.该请求可以在Chrome和Safari上正常运行,而无需接受证书.

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.

推荐答案

这是Firefox的错误:

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

必须在每个端口上分别启用证书.

You must enable the certificate on each port individually.

在Firefox中打开URL并接受证书 https://169.254.128.2:8443 https://169.254.128.2:8444

Open the url in Firefox and accept the certificates for https://169.254.128.2:8443 and https://169.254.128.2:8444

这篇关于跨端口的CORS请求在Firefox上未成功,但在Chrome上有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆