Skip to content
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

more Android work #3

Merged
merged 2 commits into from
Nov 14, 2019
Merged

more Android work #3

merged 2 commits into from
Nov 14, 2019

Conversation

ekoby
Copy link
Member

@ekoby ekoby commented Nov 14, 2019

On Android we need special handling in order in intercept HTTP(S) traffic. This has to do with the way Android delegates TLS handling into native libraries.

@ekoby
Copy link
Member Author

ekoby commented Nov 14, 2019

test

@ekoby ekoby merged commit d867d1f into master Nov 14, 2019
try {
val handlerField =
URL::class.java.getDeclaredField("handler").apply { isAccessible = true }
defaultHTTPSHandler = URL("https://google.com").let {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this actually reaching out to google as some sort of test? can you document 'what' and 'why' is going on here? this seems a little odd to me

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just used to capture default URLStreamHandler. We don't call connect() or any other methods triggering connection, so no network communication.

@ekoby ekoby deleted the more-android branch November 18, 2019 19:04
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.

None yet

2 participants