Repository navigation
Auto-refresh trust store on certificate error instead of requiring manual flag - #62
Merged
Merged
Conversation
Co-authored-by: akhanf <11492701+akhanf@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Automatically enable --refresh-trust-store on certificate errors
Auto-refresh trust store on certificate error instead of requiring manual flag
Mar 5, 2026
akhanf
marked this pull request as ready for review
March 6, 2026 02:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Users encountering TLS certificate failures had to manually re-run with
--refresh-trust-store. This change detects certificate errors automatically and retries with a fresh trust store transparently.Changes
Dcm4cheUtils(dcm4che_utils.py)_CERT_ERROR_PATTERNS— class-level list of Java/dcm4che SSL error strings used for detection (SSLHandshakeException,PKIX path building failed,ValidatorException, etc.)_MAX_RETRY_ATTEMPTS = 2— named constant for retry limit_build_commands(trust_store_option)— extracted command string construction so it can be called after a trust store refresh__init__— stores_trust_store_cache_dir,_tls_cipher,_other_optionsto support rebuilding commands mid-session_is_certificate_error(stderr)— detects cert errors in bothbytesandstrstderr_refresh_trust_store()— force-refreshes trust store and rebuilds_findscu_str/_getscu_str_execute_findscu_with_xml_output,_execute_findscu_with_xml_output_per_study,retrieve_by_StudyInstanceUID— all now loop up to_MAX_RETRY_ATTEMPTS, calling_refresh_trust_store()and retrying on a first-attempt cert errorTests (
test_dcm4che_utils.py)_is_certificate_error(positive/negative cases, bytes/str),_refresh_trust_storecommand rebuild, and retry behaviour in bothfindscuandgetscupathsOriginal prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.