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.
ANSWER: While unrelated to the OP's specific case, it may help you to know that Firefox does not trust CA's (certificate authorities) in the Windows Certificate Store by default, and this can result in failing CORS requests in Firefox (as was alluded to by Svish in the question comments).
Cross-Origin Resource Sharing (CORS) Cross-Origin Resource Sharing (CORS) is an HTTP -header based mechanism that allows a server to indicate any other origin s (domain, scheme, or port) than its own from which a browser should permit loading of resources.
CORS errors Cross-Origin Resource Sharing (CORS) is a standard that allows a server to relax the same-origin policy. This is used to explicitly allow some cross-origin requests while rejecting others. For example, if a site offers an embeddable service, it may be necessary to relax certain restrictions.
The problem is that your server does not accept your Cors request: No 'Access-Control-Allow-Origin' header is present on the requested resource. So you have to enable cors on the server side:
This is a Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=700837
You must enable the certificate on each port individually.
Open the url in Firefox and accept the certificates for
https://169.254.128.2:8443
and https://169.254.128.2:8444
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With