Hello,
From my java application I am trying to send a msg to Microsoft teams
When run from my mac works perfect
When I run from a Docker Container I am receiving a certificate error msg
Any Ideas ?
error:
javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Docker Image:
FROM alpine:3.10.3
ARG sha=‘HEAD’
LABEL vcs-ref=$sha
ENV APP_USER=“app”
RUN adduser -H -S -D “${APP_USER}”
WORKDIR /app
RUN apk update
&& apk add --no-cache
openjdk11-jdk
python3
py3-pip
py3-setuptools
py3-six
jq
curl
bash
&& pip3 install --upgrade pip==19.3.1
&& pip install --upgrade awscli boto3
&& rm -rf /root/.cache
&& apk del py3-pip py3-setuptools build-base linux-headers pcre-dev openssl-dev
&& rm -rf /var/cache/apk/*
ENV JAVA_HOME=/usr/lib/jvm/default-jvm
ENV PATH="{JAVA_HOME}/bin:{PATH}"
Code:
List configsMsTeams = configMsTeamsRepository.findAll();
String url = “”;
if (configsMsTeams.size() <= 0) {
return;
}
url = configsMsTeams.get(0).getUrl();
String message = notification.getMessage();
Card card = new Card("Card \"Test card\"", "0078D7",
"Cargo ID: " + notification.getData().get("cargoId"));
card.setText(message);
new TeamsClient(url).sendMessage(card);
} catch (Exception e) {
LOG.error("Error while sending notification to teams: ", e.getMessage());
}