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

Error when connecting to local WP Admin: Invalid request (Unsupported SSL request) #23

Closed
joshiefishbein opened this issue Jan 29, 2018 · 4 comments
Labels

Comments

@joshiefishbein
Copy link

Description of your issue

I get this when I navigate to wp-admin on my local: Invalid request (Unsupported SSL request). It looks like it keeps forcing localhost to use https://localhost:3000 when it's hosted on http:// but I don't believe it's my local SSL config because it works for other environments.

Any thoughts?

Steps to Reproduce

Regular install process for development on local machine

@PhilippHeuer
Copy link
Owner

#22 had the same issue as you now and it prob. was a misconfiguration in the .env - so you could check your config.

Im going to try to reproduce this tomorrow to help you.
Maybe it's just a error in my wiki.

@joshiefishbein
Copy link
Author

Hey @PhilippHeuer !!

Thanks for responding so quickly to this.

Here's my .env just in case you think it might be that:

CUSTOM_DB_URL=mysql://root:root@127.0.0.1:3306/project_name

DB_NAME=project_name
DB_USER=root
DB_PASSWORD=root

# Optional variables
DB_HOST=localhost
DB_PREFIX=escapod_

WP_ENV=development
WP_HOME=http://localhost
WP_SITEURL=${WP_HOME}/wp

# Salts below here

I've also tried messing around with the WP_HOME and WP_SITEURL variable without any luck. I've also turned off these settings in application.php:

define('FORCE_SSL_LOGIN', true);
define('FORCE_SSL_ADMIN', true);

And while turning these things to false let me connect successfully with http:// it blocks a few gets/posts that the WP core does on the admin page because of the non-SSL protocol.

Lemme know if you need any other info from to hunt this down. I love WP and I love Heroku, and I haven't ever had any success with any other build package. This is the closest I've gotten to making this relationship work and it's done in such a straightforward way, so anyway I can contribute would be great.

@PhilippHeuer
Copy link
Owner

I added a check so that FORCE_SSL_LOGIN and FORCE_SSL_LOGIN are only set if the WP_ENV isn't development in the application.php, thx for investigating this on your own.

So make sure you have it set to development.

// Enforce SSL for Login/Admin in production
if(env('WP_ENV') != "development") {
    define('FORCE_SSL_LOGIN', true);
    define('FORCE_SSL_ADMIN', true);
}

Now the command to run wp-cli in the wiki is wrong to start the webserver, to fix enable/disable plugins ... i had to set the path to the real wp directory - which is in turn is breaking the webserver.

Therefore you have to overwrite the path when you run the server using wp-cli to use web directly.

php wp-cli.phar server --host=0.0.0.0 --port=80 --path=web

@PhilippHeuer
Copy link
Owner

PhilippHeuer commented Jan 30, 2018

And you only need to set the CUSTOM_DB_URL, you can remove all the DB ENV variables as they get overwritten using the CUSTOM_DB_URL.

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

No branches or pull requests

2 participants