How to fix javax.net.ssl.SSLException when running maven in a Docker Container?

Viewed 455

I have the following issue. To build my application war file I run the following command locally:

mvn -s settings.xml -Dmaven.test.skip=true package -Popenshift

This works fine on my local machine.

However I am using s2i to build a Docker Image. Executing the exact same mvn command in the assemble script of the builder image results in the following error message:

javax.net.ssl|DEBUG|01|main|2020-06-22 14:30:18.012 UTC|SSLSocketInputRecord.java:470|Raw read (
  0000: 3C 48 54 4D 4C                                     <HTML
)
javax.net.ssl|ERROR|01|main|2020-06-22 14:30:18.017 UTC|TransportContext.java:318|Fatal (UNEXPECTED_MESSAGE): Unsupported or unrecognized SSL message (
"throwable" : {
  javax.net.ssl.SSLException: Unsupported or unrecognized SSL message
    at java.base/sun.security.ssl.SSLSocketInputRecord.handleUnknownRecord(SSLSocketInputRecord.java:433)
    at java.base/sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:175)
    at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:109)
    at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1148)
    at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1057)

I don't understand why the containerised version does not work. The exact same Docker image runs successfully and builds the application on a Windows machine but for me it fails. I suspect there is some interaction on s2i with certificates that isn't happening on my OSX docker. Where should I look?

The s2i command to build an image from the source code is as follows:

s2i build --environment-file environment.env ~/Programming/pfs-converter   pgen-dev/pgenbuilder:latest  /pgenapp:latest
0 Answers
Related