-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix add-cert-helper.sh only adding a single certificate in Chrome #2660
Fix add-cert-helper.sh only adding a single certificate in Chrome #2660
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
d1a7385
to
407d610
Compare
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.
Thank you, @PeterUpfold!
User description
Description
When running
/opt/bin/add-cert-helper.sh
, if multiple certificates are present in the directory passed in the-d
argument, only the last certificate alphabetically will be added to the Chrome store, as the same certificate alias is used for each certificate.Steps to reproduce
Prepare a certificates folder on an instance of the container, e.g.
/tmp/certs
, containing more than one root certificate.Run
Using NoVNC, open the Chrome browser and verify that only the last certificate has been added: three dots > Settings > Privacy and Security > Security > Manage certificates > Authorities.
If you View the certificate, the added certificate will have the alias SeleniumHQ displayed immediately under Certificate Hierarchy.
Any other certificates that were imported before the last alphabetical certificate will not be present.
This pull request alters the
add-cert-helper.sh
script to use a differentALIAS
for each imported certificate from the source directory.To verify this addresses the issue, repeat the process to add a directory of certificates as above. Using NoVNC, open the Chrome browser and verify the available certificates: three dots > Settings > Privacy and Security > Security > Manage certificates > Authorities.
Note that multiple certificates, if present in the source directory, are now imported.
Motivation and Context
This change is necessary in order to use
add-cert-helper.sh
to load a directory containing more than one root certificate into Chrome's root certificate store.Types of changes
Checklist
I have not run automated tests, but this change only affects the utility script
/opt/bin/add-cert-helper.sh
.PR Type
Bug fix
Description
Fixes issue where only one certificate was added to Chrome.
Introduces unique aliases for each certificate during import.
Ensures multiple certificates from a directory are imported correctly.
Changes walkthrough 📝
add-cert-helper.sh
Use unique aliases for importing multiple certificates
charts/selenium-grid/certs/add-cert-helper.sh
ALIAS
with dynamicALIAS_PREFIX
.