SSLHandshakeException when deploying Quarkus application to OpenShift using S2I build

Solution Verified - Updated -

Issue

A Quarkus application is configured to be deployed to OpenShift using the S2I process. The following step:

$ mvn package -Dquarkus.container-image.build=true

fails with an exception whose backtrace contains the following text:

 ...
  at io.quarkus.container.image.s2i.deployment.S2iProcessor.createContainerImage(S2iProcessor.java:243)
  at io.quarkus.container.image.s2i.deployment.S2iProcessor.s2iBuildFromJar(S2iProcessor.java:183)
...
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
    at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1946)
    at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:316)
    at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:310)
        at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1639)
 ...

Environment

  • Red Hat OpenShift
    • All versions
  • Quarkus
    • 1.7.3 Final (but probably other versions are also affected)
  • The OpenShift API server was configured to provide a self-signed certificate to clients

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content