java network_error ai_generated true

Could not transfer artifact com.example:lib:1.0.0 from/to central (https://repo.maven.apache.org/maven2): Received fatal alert: certificate_unknown. The repository mirror at https://internal-mirror.com/maven2 may be misconfigured.

ID: java/maven-repository-mirror-loop

Also available as: JSON · Markdown · 中文
80%Fix Rate
85%Confidence
0Evidence
2026-01-15First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
8+ active

Root Cause

The SSL certificate of the mirror repository is not trusted by the Java runtime, or the mirror is misconfigured.

generic

中文

镜像仓库的 SSL 证书不被 Java 运行时信任,或镜像配置错误。

Workarounds

  1. 95% success Import the mirror's SSL certificate into the Java truststore
    keytool -import -alias mirror -keystore $JAVA_HOME/lib/security/cacerts -file mirror.crt
  2. 90% success Use HTTPS with a trusted certificate or switch to HTTP if allowed
    <mirror><id>internal</id><url>http://internal-mirror.com/maven2</url><mirrorOf>central</mirrorOf></mirror>

Dead Ends

Common approaches that don't work:

  1. Disabling SSL verification globally in settings.xml 80% fail

    This is a security risk and may not be allowed in corporate environments.

  2. Using a different mirror without verifying its certificate 90% fail

    The new mirror may have the same issue or be malicious.