HTTP Client mutual TLS (mTLS) Websocket Error: unable to find valid certification path to requested target
Hi,
I am trying to connect to the websocket server which requires client certificates. Server and clients are both using the self-signed certificates, so they need to imported before hand. When I try to add client certificates to the SSLConfiguration
property in the http-client.private.env.json
file I get:
2024-09-12 10:27:39,199 [2519798] INFO - #c.i.h.h.r.r.c.HttpRequestRunConfiguration - Executing wss://localhost:8001
2024-09-12 10:27:39,406 [2520005] INFO - STDERR - Exception in thread "DefaultDispatcher-worker-11" sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
2024-09-12 10:27:39,406 [2520005] INFO - STDERR - at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:148)
2024-09-12 10:27:39,406 [2520005] INFO - STDERR - at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:129)
2024-09-12 10:27:39,406 [2520005] INFO - STDERR - at java.base/java.security.cert.CertPathBuilder.build(CertPathBuilder.java:297)
2024-09-12 10:27:39,406 [2520005] INFO - STDERR - at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:383)
2024-09-12 10:27:39,407 [2520006] INFO - STDERR - at java.base/sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:271)
2024-09-12 10:27:39,407 [2520006] INFO - STDERR - at java.base/sun.security.validator.Validator.validate(Validator.java:256)
2024-09-12 10:27:39,407 [2520006] INFO - STDERR - at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:241)
2024-09-12 10:27:39,407 [2520006] INFO - STDERR - at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:113)
2024-09-12 10:27:39,407 [2520006] INFO - STDERR - at io.ktor.network.tls.TLSClientHandshake.handleCertificatesAndKeys(TLSClientHandshake.kt:235)
2024-09-12 10:27:39,407 [2520006] INFO - STDERR - at io.ktor.network.tls.TLSClientHandshake.negotiate(TLSClientHandshake.kt:166)
2024-09-12 10:27:39,407 [2520006] INFO - STDERR - at io.ktor.network.tls.TLSClientHandshake$negotiate$1.invokeSuspend(TLSClientHandshake.kt)
2024-09-12 10:27:39,407 [2520006] INFO - STDERR - at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
2024-09-12 10:27:39,407 [2520006] INFO - STDERR - at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
2024-09-12 10:27:39,407 [2520006] INFO - STDERR - at kotlinx.coroutines.internal.SoftLimitedDispatcher$Worker.run(SoftLimitedDispatcher.kt:125)
2024-09-12 10:27:39,407 [2520006] INFO - STDERR - at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
2024-09-12 10:27:39,407 [2520006] INFO - STDERR - at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:608)
2024-09-12 10:27:39,407 [2520006] INFO - STDERR - at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:873)
2024-09-12 10:27:39,407 [2520006] INFO - STDERR - at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:763)
2024-09-12 10:27:39,407 [2520006] INFO - STDERR - at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:750)
2024-09-12 10:27:39,407 [2520006] INFO - STDERR - Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [ComponentManager(ApplicationImpl@822356094), CoroutineName(HttpClientCoroutinesService Child), StandaloneCoroutine{Cancelling}@112f9b26, LimitedDispatcher@1145e1d]
2024-09-12 10:27:39,848 [2520447] INFO - #c.i.w.i.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities com.intellij.platform.workspace.jps.entities.SdkEntity to files
2024-09-12 10:27:39,848 [2520447] INFO - #c.i.w.i.i.j.s.JpsGlobalModelSynchronizerImpl - Saving global entities com.intellij.platform.workspace.jps.entities.LibraryEntity to files
Server certificates are imported in the IDE. Checking “Accept non-trusted certificates automatically” in the setting has no effect.
请先登录再写评论。
https://youtrack.jetbrains.com/issue/IDEA-261619/i-get-this-error-when-i-save-my-file-Unable-to-find-valid-certification-path-to-requested-target#focus=Comments-27-4678082.0-0