question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

Hi,

I’m setting up a minimal Realm Kotlin (Android only) sample but as soon as I call:

app.login(Credentials.anonymous())

I get the following ConnectionException: [Custom][Unknown(1002)] java.security.cert.CertificateException: Domain specific configurations require that hostname aware checkServerTrusted(X509Certificate[], String, String) is used.

As I just followed the official documentation: Do you have any ideas what’s wrong?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
pveghcommented, Jun 30, 2022

Thanks for that hint! Currently we need this config, will look for a workaround.

Looks like the problem is not on realm’s end, I think this can be closed.

0reactions
edualonsocommented, Jun 22, 2022

When I remove this config, the app.login() call succeeds. Is there any need for a specific config for Realm Sync?

No, you shouldn’t need any specific network configuration to run Sync.

If you still need to have a domain-specific configuration please be aware of the existence of a bug in the Ktor library, which we use internally as our network transport for enabling Sync: https://youtrack.jetbrains.com/issue/KTOR-2243/Android-CIO-client-fail-with-javasecuritycertCertificateException#focus=Comments-27-5915979.0-0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Network security configuration not working with third party API
If your network config contains any <domain-config blocks, Framework throws CertificateException if you call checkServerTrusted(X509Certificate ...
Read more >
Android network security configuration not working
CertificateException : Domain specific configurations require that hostname aware checkServerTrusted(X509Certificate[], String, String) is ...
Read more >
core/java/android/security/net/config/RootTrustManager.java
throw new CertificateException(. "Domain specific configurations require that hostname aware". + " checkServerTrusted(X509Certificate[], String, String) is ...
Read more >
"server TLS certificate untrusted" error connecting to sync ...
CertificateException : Domain specific configurations require that hostname aware checkServerTrusted(X509Certificate[], String, String) is ...
Read more >
X509ExtendedTrustManager - Android Developers
chain, X509Certificate : the peer certificate chain. authType, String : the key exchange algorithm used. engine, SSLEngine : the engine used for this ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found