类 OkHttpClientUtil

java.lang.Object
dev.tinyflow.core.util.OkHttpClientUtil

public final class OkHttpClientUtil extends Object
Utility class for creating and configuring OkHttpClient instances.

By default, it uses secure TLS settings. Insecure HTTPS (trust-all) can be enabled via system property tinyflow.okhttp.insecure=true, but it is strongly discouraged in production environments.

  • 字段详细资料

  • 构造器详细资料

  • 方法详细资料

    • setCustomBuilder

      public static void setCustomBuilder(okhttp3.OkHttpClient.Builder builder)
      Sets a custom OkHttpClient.Builder to be used by buildDefaultClient(). This should be called during application initialization.
    • buildDefaultClient

      public static okhttp3.OkHttpClient buildDefaultClient()
      Returns a shared default OkHttpClient instance with reasonable timeouts and optional proxy. If a custom builder was set via setCustomBuilder(okhttp3.OkHttpClient.Builder), it will be used.

      SSL is secure by default. Insecure mode (trust-all) can be enabled via system property: -Dtinyflow.okhttp.insecure=true

    • isInsecureModeEnabled

      private static boolean isInsecureModeEnabled()
    • enableInsecureSsl

      private static void enableInsecureSsl(okhttp3.OkHttpClient.Builder builder)
    • configureProxy

      private static void configureProxy(okhttp3.OkHttpClient.Builder builder)
    • getProxyHost

      private static String getProxyHost()
    • getProxyPort

      private static String getProxyPort()