-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add SSL/HTTPS to WP-Cypress #104
base: release/1.0.0
Are you sure you want to change the base?
Conversation
…ate and no port was provided
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I have this working based on your steps, I have to tell the Cypress browser to trust the cert before I was able to run any tests without interruption. Of course this is not idea for automated situations but gets us one step further.
One query and possible suggestion I do have is around defining the cert/key in the config. As cypress has support for defining these items in cypress.json
/cypress.config.json
using the clientCertificates
property, would it not make more sense to leverage what is set there rather than have an additional config for WP-Cypress certificates? This would allow us to stay as consistent as possible with Cypress and end users who will be configuring their own setups.
Curious to hear your thoughts on that.
Thanks. Using the default |
@ampersarnie I've been thinking. If I use clientCertificates, won't that cause backwards incompatibility issues due to the port number being different in the URL? I could create a separate property in wpContent just for enabling/disabling SSL but I'm not sure if that's a good solution. Thoughts? |
Adds the option to use SSL certificates when using WP-Cypress
Description
Partially fixes #88 - allows the user to add their own SSL certificates using the
sslCertificate
property incypress.json
. If the user does provide a certificate, WP-Cypress will use the port number provided by thesslPort
property instead of theport
property incypress.json
. If ansslPort
is not provided, the port number will default to 4433 as explained in #88.Change Log
sslCertificate
andsslPort
properties incypress.json
sslCertificate
is provided, WP-Cypress will use thesslPort
port number defaulting to 4433.Types of changes (if applicable):
Checklist (if applicable):
Stuff to add to the wiki
Configuration Schema
After 'url' and before 'ports' this should be add to the configuration schema:
null
4433
sslCertificate
sslCertificate
object
cert
string
path/to/ssl-certificate
key
string
path/to/ssl-key
sslPort
number
3773
Guide
Here are the steps to get https working with WP-Cypress:
mkcert localhost
in the directory you want your certificate and key to be located (you must call the certificate localhost since it needs to be valid for that domain name)cypress.json
file:Note that the Cypress browser itself will not trust SSL certificates due to the proxy it uses. If you want to test that it works, copy the URL and use a different browser. The new browser should show that the connection is secure.