I recently activated HTTPs on a WordPress website and immediately received the error You do not have sufficient permissions to access this page when trying to access the WordPress dashboard. I could view the website posts and pages but just couldn’t access anything within the Dashboard. Also every time I tried to access the Dashboard I’d need to login again.
The HTTPs configuration
The website is setup with WordPress version 4, The WooThemes Fashionable theme and the WordPress HTTPS (SSL), CloudFlare and WooCommerce Plugins. CloudFlare is used for optimization and CDN as well as supplying the CloudFlare Flexible SSL (I’ve setup WordPress HTTPs using CloudFlare Flexible SSL numerous times in the past).
All good quality themes and plugins so what could be causing the error? I tried all sorts of things such as resetting directory and file permissions on the server, reinstalling WordPress and so on. Eventually the problem became evident.
How to fix the WordPress SSL permissions problem
What was causing the issue was WooCommerce. WooCommerce uses a native WordPress function of checking whether SSL is active called is_ssl. The issue with this means of testing for SSL is that it doesn’t natively work for websites with SSL behind load balancers or where SSL isn’t on your webserver (such as with CloudFlare Flexible SSL). What we need to do then is trick WordPress into knowing that we are in fact using SSL.
Fortunately Ross from Webaware has put in the hard yards for us and has created a plugin that does all the heavy lifting for us. I installed the plugin and now am able to access the Dashboard without error.