Skip to content

SSL Support: Install root certificate directly on Windows instead of opening folder - #1327

Merged
gavande1 merged 14 commits into
trunkfrom
add/install-ssl-certificate-windows
May 8, 2025
Merged

SSL Support: Install root certificate directly on Windows instead of opening folder#1327
gavande1 merged 14 commits into
trunkfrom
add/install-ssl-certificate-windows

Conversation

@gavande1

@gavande1 gavande1 commented May 6, 2025

Copy link
Copy Markdown
Contributor

Related issues

Proposed Changes

  • Attempt to install Root SSL certificate on Windows

Why changes are being made

On Windows, the certificate installation process can be automated. Previously, we opened the folder containing the certificate, requiring manual installation. This PR updates the behavior to call trustRootCA() on Windows, automatically installing the certificate when it’s not trusted.

Testing Instructions

  • Apply this PR on Windows
  • If your certificate is already trusted, remove it from the certificate manager.
  • run npm start
  • Add HTTPS to your site.
  • Go to site settings, you should see the "Trust certificate" link
  • When you click on it, you should see a dialogue box asking permission to execute the script.
  • On trust, it will just open the file explorer in the certificates folder.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@gavande1
gavande1 changed the base branch from trunk to hide/ssl-help-trusted-certificate May 6, 2025 06:06
@gavande1 gavande1 changed the title Add/install ssl certificate windows May 6, 2025
@gavande1
gavande1 marked this pull request as ready for review May 6, 2025 06:14
@gavande1
gavande1 requested a review from a team May 6, 2025 10:03
@gavande1
gavande1 force-pushed the hide/ssl-help-trusted-certificate branch from f889895 to 0169e08 Compare May 6, 2025 13:22
@gavande1
gavande1 changed the base branch from hide/ssl-help-trusted-certificate to trunk May 6, 2025 13:46
@gavande1
gavande1 force-pushed the add/install-ssl-certificate-windows branch from 79b84c9 to d4782aa Compare May 6, 2025 13:47
@gavande1
gavande1 changed the base branch from trunk to hide/ssl-help-trusted-certificate May 6, 2025 13:48
@gavande1 gavande1 self-assigned this May 7, 2025
@gavande1
gavande1 force-pushed the add/install-ssl-certificate-windows branch from d4782aa to 75ae810 Compare May 7, 2025 06:47
@gavande1
gavande1 force-pushed the hide/ssl-help-trusted-certificate branch from 0169e08 to 977bc7d Compare May 7, 2025 06:49
@gavande1
gavande1 force-pushed the add/install-ssl-certificate-windows branch from 75ae810 to 4f0e1d2 Compare May 7, 2025 06:50
Base automatically changed from hide/ssl-help-trusted-certificate to trunk May 7, 2025 07:28

@fredrikekelund fredrikekelund left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is getting there, but I have two comments:

  1. The thing about not failing silently if trustRootCA fails.
  2. We should automatically refresh the trust status after getIpcApi().trustCertificate() finishes executing. After landing #1325, we can do this like so:
onClick={ async () => {
	await getIpcApi().trustCertificate();
	await dispatch(
		certificateTrustApi.util.invalidateTags( [ 'CertificateTrust' ] )
	);
} }
Comment thread src/ipc-handlers.ts Outdated
@gavande1
gavande1 force-pushed the add/install-ssl-certificate-windows branch from 4f0e1d2 to 964b4f2 Compare May 7, 2025 09:14
@gavande1
gavande1 requested a review from fredrikekelund May 7, 2025 11:52

@fredrikekelund fredrikekelund left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's land #1325 first and also make the invalidateTags change I suggested before landing this.

Comment thread src/ipc-handlers.ts Outdated
Comment thread src/ipc-handlers.ts Outdated
Comment thread src/components/content-tab-settings.tsx Outdated
@gavande1
gavande1 force-pushed the add/install-ssl-certificate-windows branch from f2205ef to 6c8aa0c Compare May 7, 2025 13:14
Comment thread src/components/content-tab-settings.tsx Outdated
@gavande1

gavande1 commented May 7, 2025

Copy link
Copy Markdown
Contributor Author

Thanks both of you, @nightnei and @fredrikekelund, for amazing suggestions. The PR is ready to be reviewed again.

Comment thread src/components/content-tab-settings.tsx Outdated

@nightnei nightnei left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM and works well 👍
Screenshot 2025-05-07 at 15 53 56

@gavande1
gavande1 merged commit e3747de into trunk May 8, 2025
@gavande1
gavande1 deleted the add/install-ssl-certificate-windows branch May 8, 2025 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants