admin管理员组

文章数量:1281065

Java project using apache airflow. Here is dockerfile in root directory:

FROM apache/airflow:2.10.0

USER root

ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64/
ENV PATH="${JAVA_HOME}/bin/:${PATH}"

RUN DOWNLOAD_URL=".0.2_linux-x64_bin.tar.gz" \
&& TMP_DIR="$(mktemp -d)" \
&& curl -fL "${DOWNLOAD_URL}" --output "${TMP_DIR}/openjdk-11.0.2_linux-x64_bin.tar.gz" \
&& mkdir -p "${JAVA_HOME}" \
&& tar xzf "${TMP_DIR}/openjdk-11.0.2_linux-x64_bin.tar.gz" -C "${JAVA_HOME}" --strip-components=1 \
&& rm -rf "${TMP_DIR}" \
&& java --version

COPY cert/cert_name.crt /usr/local/share/ca-certificates/

RUN update-ca-certificates

USER airflow

WORKDIR /app

And there is an Airflow DAG in this project, that should send a POST request to external service. But after sending, i receive an error in logs:

Task error: Error executing request: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid

Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested targetcertification path to requested target

I open the URL from request path in browser, downloaded the certificate, adding to directory in project and adding this 2 lines in dockerfile above:

COPY cert/cert_name.crt /usr/local/share/ca-certificates/

RUN update-ca-certificates 

But it doesn't help, the error still comes back. Please help me, am i doing something wrong? What i need to correct?

本文标签: linuxHow to fixunable to find valid certification path to requested targetStack Overflow