Skip to content

Fix: Stop silently inheriting SSL_CERT_FILE from process env#2094

Merged
amangalampalli-ks merged 2 commits into
fix/ssl-cert-file-inheritancefrom
fix/ssl-cert-file-inheritance-int
May 29, 2026
Merged

Fix: Stop silently inheriting SSL_CERT_FILE from process env#2094
amangalampalli-ks merged 2 commits into
fix/ssl-cert-file-inheritancefrom
fix/ssl-cert-file-inheritance-int

Conversation

@amangalampalli-ks
Copy link
Copy Markdown
Contributor

Summary

Fixes: #2069
On Windows, Commander silently honored SSL_CERT_FILE if set in the environment by unrelated tools (Zscaler, Anaconda, IT scripts), redirecting trust away from the bundled _internal\certifi\cacert.pem. This broke the workflow for customers behind TLS-inspecting proxies.

Fix

  • Removed the ssl.get_default_verify_paths() block in get_ssl_cert_file() so Commander no longer inherits trust decisions from the surrounding env.
  • Default is now always the bundled certifi store; KEEPER_SSL_CERT_FILE (certifi | system | none/false | <path>) remains the supported explicit override.
  • Consolidated the duplicate get_ssl_cert_file() (existed in both __main__.py and utils.py) into a single implementation in utils.py.

Testing (Windows)

Test Using SSL certificate file:
Clean env bundled certifi
SSL_CERT_FILE poisoned (bug repro) bundled certifi (was the unexpected path before)
KEEPER_SSL_CERT_FILE=<path> expected path
keeper login on clean env reaches login prompt

@amangalampalli-ks amangalampalli-ks self-assigned this May 28, 2026
@amangalampalli-ks amangalampalli-ks marked this pull request as ready for review May 28, 2026 06:13
Comment thread keepercommander/utils.py
…hon package name

The hyphen in os-keychain caused find_packages() to skip the directory,
so it was not included in the PyPI wheel. PyInstaller also failed to
bundle it correctly. Renaming to os_keychain (underscore) fixes both.

loader.py normalises the URI scheme (os-keychain -> os_keychain) before
resolving the plugin module, so config.json entries are unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
@amangalampalli-ks amangalampalli-ks merged commit 8f8162e into fix/ssl-cert-file-inheritance May 29, 2026
4 checks passed
amangalampalli-ks added a commit that referenced this pull request May 29, 2026
* fix: honor bundled certifi store on Windows

* fix: rename os-keychain plugin directory to os_keychain for valid Python package name

The hyphen in os-keychain caused find_packages() to skip the directory,
so it was not included in the PyPI wheel. PyInstaller also failed to
bundle it correctly. Renaming to os_keychain (underscore) fixes both.

loader.py normalises the URI scheme (os-keychain -> os_keychain) before
resolving the plugin module, so config.json entries are unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: sshrushanth-ks <sshrushanth@keepersecurity.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
sk-keeper pushed a commit that referenced this pull request May 29, 2026
* fix: honor bundled certifi store on Windows

* fix: rename os-keychain plugin directory to os_keychain for valid Python package name

The hyphen in os-keychain caused find_packages() to skip the directory,
so it was not included in the PyPI wheel. PyInstaller also failed to
bundle it correctly. Renaming to os_keychain (underscore) fixes both.

loader.py normalises the URI scheme (os-keychain -> os_keychain) before
resolving the plugin module, so config.json entries are unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: sshrushanth-ks <sshrushanth@keepersecurity.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
sk-keeper pushed a commit that referenced this pull request May 29, 2026
* fix: honor bundled certifi store on Windows

* fix: rename os-keychain plugin directory to os_keychain for valid Python package name

The hyphen in os-keychain caused find_packages() to skip the directory,
so it was not included in the PyPI wheel. PyInstaller also failed to
bundle it correctly. Renaming to os_keychain (underscore) fixes both.

loader.py normalises the URI scheme (os-keychain -> os_keychain) before
resolving the plugin module, so config.json entries are unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: sshrushanth-ks <sshrushanth@keepersecurity.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@sgaddala-ks sgaddala-ks deleted the fix/ssl-cert-file-inheritance-int branch May 30, 2026 05:03
jpkeepersecurity pushed a commit that referenced this pull request Jun 1, 2026
* fix: honor bundled certifi store on Windows

* fix: rename os-keychain plugin directory to os_keychain for valid Python package name

The hyphen in os-keychain caused find_packages() to skip the directory,
so it was not included in the PyPI wheel. PyInstaller also failed to
bundle it correctly. Renaming to os_keychain (underscore) fixes both.

loader.py normalises the URI scheme (os-keychain -> os_keychain) before
resolving the plugin module, so config.json entries are unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: sshrushanth-ks <sshrushanth@keepersecurity.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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.

4 participants