quarkiverse / quarkus-minio

Minio (https://min.io) Client Quarkus Extension
Apache License 2.0
18 stars 24 forks source link

PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException #202

Closed corentin59 closed 1 year ago

corentin59 commented 1 year ago

Hello,

I try to upgrade quarkus from 2.14.2.Final to 2.16.4.Final (I have not tested the intermediate versions). When I try to access to minio client (get, stat, etc...), an exception is throwed :

java.lang.RuntimeException: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

My Minio HTTP endpoint is in TLS mode with an auto-signed cert. Is there a workaround to force the request (even in unsigned SSL mode) ? Yes, it's a bad practice :)

This option don't work : quarkus.ssl.native = false

jtama commented 1 year ago

Hi do you have quarkus-micrometer ? Can you provide a reproducer ?

jtama commented 1 year ago

Also, which minio extension version do you use ?

corentin59 commented 1 year ago

Hi,

jtama commented 1 year ago

So you only upgraded quarkus version? I can't see how the issue could come from the minio extension. Internaly minio sdk uses okhttp3, which hasn't been updated between 2.14.2.Final to 2.16.4.Final...

Was the only update you made the quarkus version ?

corentin59 commented 1 year ago

I will check my project revision and retry to give more informations

corentin59 commented 1 year ago

Hi,

I found the problem. When upgrading quarkus versions I also re-installed my JDK. In development the certificate is read from the keystore and in production directly from kubernetes.

Nevertheless, I don't understand why I was able to make a listObjects without TLS error. The error occurs at the get.

Sorry to bother you :)

jtama commented 1 year ago

No problem, I'll close the issue for now, we will re-open it if needed.