Skip to content

Android crash with trustAllCerts=true: hostname-aware checkServerTrusted(...) exception #26

@zuev98

Description

@zuev98

Problem

On Android, enabling trustAllCerts=true can crash during TLS setup with:

Domain specific configurations require that hostname aware checkServerTrusted(X509Certificate[], String, String) is used

This happens when using the current JVM-based HttpClient configuration on Android.

Environment

  • Platform: Android
  • Ktor engine: (current default / JVM-based config)
  • Mode: trustAllCerts=true

Proposed fix

I opened a PR that provides an Android-specific (androidMain) HttpClient implementation based on Ktor OkHttp engine, which avoids the hostname-aware checkServerTrusted(...) requirement on Android.

PR: #25

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions