Configure Maven to Skip SSL Certificate Verification: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
=External=
* http://maven.apache.org/wagon/wagon-providers/wagon-http/
=Internal=
=Internal=


Line 12: Line 8:


  mvn clean install
  mvn clean install
  Downloading: https://nexus-cicd.apps.openshift.novaordis.io/content/groups/public/org/apache/maven/plugins/maven-source-plugin/maven-metadata.xml
  Downloading: https://nexus-cicd.apps.openshift.novaordis.io/content/groups/public/org/apache/maven/plugins/maven-source-plugin/maven-metadata.xml
  [WARNING] Could not transfer metadata org.apache.maven.plugins:maven-source-plugin/maven-metadata.xml from/to nexus \
  [WARNING] Could not transfer metadata org.apache.maven.plugins:maven-source-plugin/maven-metadata.xml from/to nexus \
  (https://nexus-cicd.apps.openshift.novaordis.io/content/groups/public/): sun.security.validator.ValidatorException: \
  (https://nexus-cicd.apps.openshift.novaordis.io/content/groups/public/): sun.security.validator.ValidatorException: \
  PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
  PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target


Additional configuration is required to make the underlying [[HttpComponents HttpClient|HttpClient]] to ignore the SSL self-signed certificate and to proceed with the HTTP connection.
=Use Maven Wagon System Properties=
Set one of the following on the maven command line:
-Dmaven.wagon.http.ssl.insecure=true
-Dmaven.wagon.http.ssl.allowall=true
-Dmaven.wagon.http.ssl.ignore.validity.dates=true


More details {{External|http://maven.apache.org/wagon/wagon-providers/wagon-http/}}


with a repository that is uses self-signed certificates
<font color=red>'''TODO''': Did not work.</font>


Set the appropriate system property in command line:
=Configure Maven to Accept Self-Signed Certificates=


-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true
{{Internal|Configure a Java HTTP Client to Accept Self-Signed Certificates|Configure a Java HTTP Client to Accept Self-Signed Certificates}}

Latest revision as of 10:16, 9 December 2017

Internal

Overview

If maven is configured to download dependencies from a HTTPS repository that uses self-signed certificates, it fails with:

mvn clean install
Downloading: https://nexus-cicd.apps.openshift.novaordis.io/content/groups/public/org/apache/maven/plugins/maven-source-plugin/maven-metadata.xml
[WARNING] Could not transfer metadata org.apache.maven.plugins:maven-source-plugin/maven-metadata.xml from/to nexus \
(https://nexus-cicd.apps.openshift.novaordis.io/content/groups/public/): sun.security.validator.ValidatorException: \
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Additional configuration is required to make the underlying HttpClient to ignore the SSL self-signed certificate and to proceed with the HTTP connection.

Use Maven Wagon System Properties

Set one of the following on the maven command line:

-Dmaven.wagon.http.ssl.insecure=true 
-Dmaven.wagon.http.ssl.allowall=true 
-Dmaven.wagon.http.ssl.ignore.validity.dates=true

More details

http://maven.apache.org/wagon/wagon-providers/wagon-http/

TODO: Did not work.

Configure Maven to Accept Self-Signed Certificates

Configure a Java HTTP Client to Accept Self-Signed Certificates