Skip to content

Fixes and updates for local testing over HTTPS#11768

Merged
matthinz merged 3 commits intomainfrom
matthinz/local-https-fixes
Jan 17, 2025
Merged

Fixes and updates for local testing over HTTPS#11768
matthinz merged 3 commits intomainfrom
matthinz/local-https-fixes

Conversation

@matthinz
Copy link
Contributor

🛠 Summary of changes

I had some trouble getting local testing working over HTTPS on iPhone, which (it seems), no longer has a "Proceed anyway" type link available when it encounters a self-signed certificate. Working around this involved:

  1. Explicitly binding to my IP address rather than 0.0.0.0
  2. Not including a port number in the CN field of the self-signed cert.
  3. Adding a subjectAltName to the self-signed cert.

This PR:

  • Updates the docs to recommend binding to an explicit IP address to address item 1
  • Updates SSL cert generation to address items 2+3

- Don't include port in CN
- Add SAN including the IP address (required for Safari on iOS)

[skip changelog]
- Bind to a specific IP
- Describe how to trust cert on iOS
@aduth
Copy link
Contributor

aduth commented Jan 17, 2025

Copy link
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This unfortunately didn't work for me, but I also didn't try the "Special instructions" (aside: Do those instructions work on managed devices?). But since it's completely busted anyways, anything which works for someone is a 👍 from me.

Comment on lines -218 to +219
-subj "/C=US/ST=District of Columbia/L=Washington/O=GSA/OU=Login.gov/CN=$(HOST):$(PORT)" \
-subj "/C=US/ST=District of Columbia/L=Washington/O=GSA/OU=Login.gov/CN=$(HOST)" \
-addext "subjectAltName=IP:$(HOST)" \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If someone has existing files, it'd be nice if we could somehow invalidate those without them having to manually remove them. Maybe the output filenames should exclude the port, which has a dual effect of reflecting these changes and forcing a rebuild of existing certificates?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I was thinking about that as well. I'll make the update--the cert should work for any port.

This will ensure new keys / certs are generated without requiring folks to remove the old ones first.
@matthinz
Copy link
Contributor Author

Do those instructions work on managed devices?

Yes, I was able to get this working with my GFE iPhone using the special instructions.

@matthinz matthinz merged commit 08baaa9 into main Jan 17, 2025
@matthinz matthinz deleted the matthinz/local-https-fixes branch January 17, 2025 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants