Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mixed content error on post editing pages (admin) #2494

Open
luis-movel opened this issue Nov 12, 2022 · 1 comment
Open

Mixed content error on post editing pages (admin) #2494

luis-movel opened this issue Nov 12, 2022 · 1 comment

Comments

@luis-movel
Copy link

Issue description:

Error:

Mixed Content: The page at 'https://****.com.br' was loaded over HTTPS, but requested an insecure font 'http://***.com.br/?action=kirki-styles&editor=1&ver=4.0'. This request has been blocked; the content must be served over HTTPS.

It's happening on post editing pages (admin).

Important:

Consider that in this case the webserver doesn't have a SSL certificate and it's behind a load balancer that decrypt the HTTPS call. This load balancer is the location of our SSL certificate.

Because of this, it seems that the plugin is building the links without HTTPS. We think it would work properly if the links building were based on the $_SERVER['https'] variable.

The code snippet bellow is applied on wp-config.php to check and define the variable mentioned above.

/** Detect if SSL is used. This is required since we are terminating SSL either on CloudFront or on ELB */
$http_cloudfront_forwarded_proto = $_SERVER['HTTP_CLOUDFRONT_FORWARDED_PROTO'] ?? null;
$http_x_forwarded_proto = $_SERVER['HTTP_X_FORWARDED_PROTO'] ?? null;
if ($http_cloudfront_forwarded_proto == 'https' OR $http_x_forwarded_proto == 'https') {
    $_SERVER['HTTPS']='on';
}

Version used:

4.0.24

PHP error messages that might be related

Mixed Content: The page at 'https://****.com.br' was loaded over HTTPS, but requested an insecure font 'http://***.com.br/?action=kirki-styles&editor=1&ver=4.0'. This request has been blocked; the content must be served over HTTPS.

@DeoThemes
Copy link

Getting the same error. What is the solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants