Code Monkey home page Code Monkey logo

PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target; nested exception is javax.net.ssl.SSLHandshakeException about spring-boot-admin HOT 4 CLOSED

pSinghDelaplex avatar pSinghDelaplex commented on June 2, 2024
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target; nested exception is javax.net.ssl.SSLHandshakeException

from spring-boot-admin.

Comments (4)

SteKoe avatar SteKoe commented on June 2, 2024

Hi,

this sounds like a general issue in setting up self-signed certificates in Java context. Make sure that the JRE/JDK you are using has imported the self-signed p12 certificate into its cacerts file by running keytool:

keytool -v -importkeystore -srckeystore localhost-ssl.p12 -srcstoretype PKCS12 -destkeystore "<path to your jdk/jre>/lib/security/cacerts" -deststoretype JKS

Cheers,
SteKoe

from spring-boot-admin.

pSinghDelaplex avatar pSinghDelaplex commented on June 2, 2024

Hi @SteKoe ,

I have imported the self-signed p12 certificate into its cacerts file. But his also, doesn't resolved the issue and now throwing warning

[2024-03-21 12:58:43.843] [,] [WARN ] [ 153] [ApplicationRegistrator ]: Failed to register application as Application(name=sample-service, managementUrl=https://127.0.0.1:8080/sample/actuator, healthUrl=https://127.0.0.1:8080/sample/actuator/health, serviceUrl=https://127.0.0.1:8080/sample) at spring-boot-admin ([https://localhost:1234/instances]): I/O error on POST request for "https://localhost:1234/instances": Certificate for doesn't match any of the subject alternative names: []; nested exception is javax.net.ssl.SSLPeerUnverifiedException: Certificate for doesn't match any of the subject alternative names: []. Further attempts are logged on DEBUG level

from spring-boot-admin.

erikpetzold avatar erikpetzold commented on June 2, 2024

@pSinghDelaplex as you have self signed certificates, they are not trusted by default. So your spring boot admin server needs to trust the certificate of your application and your application needs to trust the certificate of your spring boot admin server.
That is why you needed to import them. If you import them into your jre, then all applications running on that jre will trust these certificates. So now you find a valid path to the certificate.

But your certificates do not match the host you are using them for. You could try to generate certificates that match your hosts. Otherwise, the validation can be disabled in http clients, but this would not be recommended for production systems!

from spring-boot-admin.

erikpetzold avatar erikpetzold commented on June 2, 2024

As this is completely unrelated to Spring Boot Admin we will close this issue now. If you have more questions regarding that topic we recommend asking on stackoverflow or research in the docs.

from spring-boot-admin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.