Skip to content

Network pinning on Android#8376

Open
yschimke wants to merge 1 commit into
lysine-dev:masterfrom
yschimke:clean_pin_network
Open

Network pinning on Android#8376
yschimke wants to merge 1 commit into
lysine-dev:masterfrom
yschimke:clean_pin_network

Conversation

@yschimke

@yschimke yschimke commented Apr 20, 2024

Copy link
Copy Markdown
Collaborator

Cleanly pinning network on Android - #8286

    OkHttpClient
      .Builder()
      .addInterceptor(AndroidNetworkPinning())
      .build()

// Substitute in some preferred network here
val activeNetwork = connectivityManager.activeNetwork

val request = Request.Builder()
  .url(server.url("/"))
  .tag<Network>(activeNetwork)
  .build()

@yschimke
yschimke requested a review from swankjesse April 20, 2024 11:46
@yschimke yschimke added the android Relates to usage specifically on Android label Apr 20, 2024
Comment thread okhttp-android/src/main/kotlin/okhttp3/android/AndroidAsyncDns.kt Outdated
Comment thread okhttp-android/src/main/kotlin/okhttp3/android/NetworkPin.kt Outdated
Comment thread okhttp-android/src/main/kotlin/okhttp3/android/NetworkSelection.kt Outdated
Comment thread okhttp-android/src/main/kotlin/okhttp3/android/internal/NetworkPinInterceptor.kt Outdated
Comment thread okhttp/src/main/kotlin/okhttp3/AsyncDns.kt Outdated
Comment thread okhttp-android/src/main/kotlin/okhttp3/android/NetworkPin.kt Outdated
@yschimke
yschimke marked this pull request as ready for review April 20, 2024 17:18
@yschimke yschimke changed the title Draft of network pinning on Android OkHttpClient.Builder network pinning on Android Apr 20, 2024
Comment thread okhttp/api/okhttp.api Outdated
@yschimke
yschimke requested a review from JakeWharton January 4, 2025 11:03
@yschimke
yschimke marked this pull request as draft May 26, 2025 12:21
@yschimke

This comment was marked as outdated.

@yschimke yschimke added this to the 5.x milestone Jun 22, 2025
@yschimke yschimke changed the title OkHttpClient.Builder network pinning on Android Call.Decorator network pinning on Android Aug 2, 2025
@yschimke
yschimke force-pushed the clean_pin_network branch from 4aaffaa to eb1412c Compare August 2, 2025 10:28
@yschimke
yschimke marked this pull request as ready for review August 2, 2025 11:11
@yschimke yschimke changed the title Call.Decorator network pinning on Android Network pinning on Android Apr 5, 2026
@yschimke
yschimke force-pushed the clean_pin_network branch from 6a0b187 to 9183a61 Compare April 5, 2026 14:30
@yschimke

yschimke commented Apr 5, 2026

Copy link
Copy Markdown
Collaborator Author

@swankjesse can you take another look, I think it's simple and clean enough we could land as a feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

android Relates to usage specifically on Android

Development

Successfully merging this pull request may close these issues.

2 participants