Fix the cert4android user decision dialog not being shown#694
Merged
Conversation
sunkup
force-pushed
the
692-broken-certificate-handling
branch
from
September 9, 2025 11:56
d22691d to
7bfaec4
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes certificate handling by changing the AppHttpClient architecture to properly initialize the certificate manager when the HTTP client engine is created.
- Replaced direct HttpClientEngine parameter with a factory function that creates engines with proper certificate configuration
- Updated MockServer to work with the new factory pattern while maintaining test isolation
- Simplified the engine configuration by moving SSL setup to the factory function
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| AppHttpClient.kt | Refactored to use engine factory function instead of direct engine, enabling proper certificate manager integration |
| ValidatorTest.kt | Updated test to use new factory function signature for mock HTTP client creation |
| MockServer.kt | Modified to provide engine factory function instead of direct engine instance for testing |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
sunkup
marked this pull request as ready for review
September 9, 2025 12:29
ArnyminerZ
approved these changes
Sep 10, 2025
ArnyminerZ
left a comment
Member
There was a problem hiding this comment.
Looks good, feel free to merge.
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.
Purpose
Fix the cert4android user decision dialog not being shown when needed.
Short description
Instead of passing a client engine directly to
AppHttpClientwe now pass acreateEnginefunction which allows us to configure the engine at the same time. By default we create the minimally configured OkHttp engine and it gets replaced in the mock server which passes a function which creates a mock engine.I tested (please double check), that:
Note also that accepting a certificate from within the cert4android user decision dialog does not yet work. Probably due to the Nav3 rewrite. That is tracked in #697
Checklist