frontend-maven-plugin icon indicating copy to clipboard operation
frontend-maven-plugin copied to clipboard

Allow sef-singed certificates when downloading npm and node

Open johnny-the-coder opened this issue 5 years ago • 1 comments
trafficstars

Do you want to request a feature or report a bug? feature

What is the current behavior? Goal: install-node-and-npm Could not download artifacts (node and npm) from custom location due to missing certificates. Error message:

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

What is the expected behavior? Please add a configuration parameter to goal install-node-and-npm to be able to skip ssl validation. I guess changes have to made in class FileDownloader: https://github.com/eirslett/frontend-maven-plugin/blob/master/frontend-plugin-core/src/main/java/com/github/eirslett/maven/plugins/frontend/lib/FileDownloader.java

Following code creates HttpClient that can handle self-singed certificates:

SSLContextBuilder sslContextBuilder = new SSLContextBuilder();
sslContextBuilder.loadTrustMaterial(null, new TrustSelfSignedStrategy());
SSLConnectionSocketFactory sslConSocketFactory = new SSLConnectionSocketFactory(sslContextBuilder.build());
HttpClients.custom().setSSLSocketFactory(sslConSocketFactory).build();

Please mention your frontend-maven-plugin and operating system version. 1.8.0 Windows 7

johnny-the-coder avatar Jan 21 '20 14:01 johnny-the-coder

https://issues.apache.org/jira/browse/HTTPCLIENT-1128

tomashm avatar Aug 24 '21 10:08 tomashm