Repository navigation
Conversation
Signed-off-by: jpantonow <jpantonow@gmail.com>
This branch has not been deployed
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.
What does this implement/fix?
createHttpClientcom.ivanovsky.passnotes.data.repository.file.webdav.HttpClientFactoryapp/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/webdav/HttpClientFactory.ktSSLContextSpecapeSummary
Observed dynamic-analysis failure
The dynamic-analysis run by
apereported (SSLContextSpec) while exercisingcom.ivanovsky.passnotes.data.repository.file.webdav.HttpClientFactory.createHttpClient:Root cause
The DEBUG and UNSECURE branch invokes javax.net.ssl.SSLContext.getInstance("TLS"), which violates SSLContextSpec's reported constraint requiring the requested protocol argument to be exactly "TLSv1.2" or "TLSv1.3".
Correction strategy
Retain the provider-selected generic SSLContext("TLS") and filter only explicit legacy protocol names from the provider's enabled protocol set on each derived connection/socket. Do not construct a TLSv1.2/TLSv1.3 closed allowlist; retain unknown future TLS protocol names and fail closed on an empty acceptable set.
Coordinated changes
app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/webdav/HttpClientFactory.kt: Preserves the generic TLS SSLContext and immediate initialization, then filters each provider-created SSL socket's already-enabled protocols. SSL variants and TLSv1/TLSv1.0/TLSv1.1 are removed, TLSv1.2/TLSv1.3 and future protocol names remain when provider-enabled, and an empty result throws before a socket can be returned. The internal helper is callable by the coordinated unit tests without reflection.app/src/test/kotlin/com/ivanovsky/passnotes/data/repository/file/webdav/HttpClientFactoryTest.kt: Adds direct unit coverage for the coordinated internal helper: legacy SSL and TLS protocol names are removed, provider-enabled TLSv1.2 and TLSv1.3 remain, a future TLS name remains, and an all-legacy input throws IllegalStateException rather than permitting socket configuration.Verification included
How was this tested?
:app:compileAutomationDebugKotlin); the full multi-module build was not completed in this environmentAdditional context
I’m an undergraduate Computer Engineering student at the University of Brasília (UnB), and this contribution is part of a research project involving static analysis of Android apps.
I’m happy to adjust the implementation to better match the project’s architecture, coding conventions, or maintainers’ recommendations.