FORCE_SSL_ADMIN and admin-ajax.php problem
-
When using FORCE_SSL_ADMIN with an untrusted SSL certificate, I’m having problems with some plugins (ie: wp-polls) using admin-ajax.php.
WordPress itself doesn’t force admin-ajax.php to SSL, since it’s used by non-admin code as well.
However the plugins use the admin_url() function to form the admin-ajax.php URL. The function returns a URL that will be served via https.
At that time we have a mixed content, where the rest of the site is served through http and the admin-ajax.php is served through https. If the site doesn’t have a SSL certificate that is trusted, the browser’s default behavior is to block that https connection thus breaking the ajax function.
Since many WordPress sites doesn’t have public user registration, it’s common practice to use self-signed SSL certs with such WordPress sites.
A dirty hack could be using a home_url(‘wp-admin/admin-ajax.php’) function instead but that would defeat the whole purpose of an admin_url() function.
What solution should be implemented for this problem?
- The topic ‘FORCE_SSL_ADMIN and admin-ajax.php problem’ is closed to new replies.