Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Jonathan Seligsohn
Jonathan Seligsohn
23,116 Points

Local Development of WooCommerce WP site - HTTPS

I'm going through the videos one Ecommerce with WordPress and WooCommerce, and have a localhost setup environment. I've enabled HTTPS in the settings page of WooCommerce, however when I go to a page on my localhost that would require HTTPS (like the checkout page), it doesn't work. I assume this is because I don't have HTTPS enabled on my localhost.

Any suggestions how I can enable (or 'trick') HTTPS on localhost? Or is this unnecessary for testing purposes?

Logan R
Logan R
22,989 Points

Can you please define 'not working'?

If you type in https://localhost, does it bring up https?

Also, what environment are you using? XAMPP?

Jonathan Seligsohn
Jonathan Seligsohn
23,116 Points

If I type that in, I get the following error: "Error code: ERR_SSL_PROTOCOL_ERROR". I'm using MAMP. Basically, the test site works but when I click on cart or account (for example), the link is to HTTPS, which the server can't find (it can only find http links). At least that's what I think is happening.

1 Answer

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

You may have to upgrade to MAMP Pro, although this tutorial covers how to do it: https://tommcfarlin.com/enable-ssl-in-mamp/

If you really want to test SSL and payment gateways though, I would suggest a development server rather than trying to test that locally. Then you can focus on your site dev locally and test the rest in on a live development/testing server.

Jonathan Seligsohn
Jonathan Seligsohn
23,116 Points

Thanks. I was trying to simulate the entire experience locally, but you're right that I'm better off doing the SSL and payment gateways on a development server. I suppose I should just turn off "use HTTPS" in the settings while developing locally. Nonetheless, I'll definitely check out the link you included.