DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • The Relationship Between Performance and Security
  • How To Learn Cyber Security Step-by-Step
  • 5 Common Firewall Misconfigurations and How to Address Them
  • Security Architecture Review on a SASE Solution

Trending

  • Rethinking Java CRUDs With Event Sourcing and CQRS Patterns
  • Why DDoS Protection Is an Architectural Decision for Developers
  • Stateless JWT Auth Microservice Architecture With Spring Boot 3 and Redis Sentinel
  • Lambda-Driven API Design: Building Composable Node.js Endpoints With Functional Primitives
  1. DZone
  2. Software Design and Architecture
  3. Security
  4. How to Resolve 'PKIX Path Building Failed' Issue

How to Resolve 'PKIX Path Building Failed' Issue

The 'PKIX path building failed: unable to find valid certification path to requested page' error causes the firewall to restrict the application connection.

By 
Abhishek Bathwal user avatar
Abhishek Bathwal
·
Mar. 07, 21 · Tutorial
Likes (1)
Comment
Save
Tweet
Share
29.6K Views

Join the DZone community and get the full member experience.

Join For Free

While developing some application, we might sometimes come across the below error which the maven throws while building the application:

Error Highlighted

Reason: The error is due to the system firewall. The system firewall restricts the application to connect to external unsecured systems. The firewall requires a valid certificate to allow access to the external systems.

Solution: The solution is very simple. We just need to install the required certificates of the external system in our system so the firewall allows us to interact with the external system and complete our process.

We are going to perform two activities:

  1. Download the Certificate.
  2. Install the Certificate.

To Download the Certificate, Follow the Below Steps:

1. Take the particular URL from the error and copy it to a browser (In the above error the URL is https://repository.mulesoft.org/releases/). URL from Error pasted into Browser

2. Now to the left of the URL, there is a 'lock' icon. Click on this icon and a window will pop up. From the window, select the certificate.Lock Icon UI

3. Once we select the certificate, it will redirect to another window. From there we have to select the Details tab and from the Details click on Copy to File. After clicking again, a new window will pop up. In that window, select next.Certificate Details > Copy to File...

Certificate Export Wizard Welcome Screen

4. After we perform all the above steps, we will be redirected to a new window where we need to select the format for the certificate. We will have to choose DER encoded binary and click on Next.Selecting DER encoded binary

5. Now we need to choose a location where we need to save the certificate and we also need to give some name to the certificate.File to Export UI

Selecting File

6. Once a file name is given and saved, then select Next. It will direct us to another window showing the details. If all the details are correct, click on Finish. An export Success pop-up will appear.

Note: I saved the File name as repo.Completing the Certificate Export Wizard

Success Pop-up


So, the downloading of certificates is done. Now the next process is to install the certificate in the cacerts file of the jdk installed in our system using the command line.

Installation of the Certificate From Command Line:

Command for Installation:

Java
 




x


 
1
keytool -importcert -trustcacerts -alias <alias name for the certificate> -file <path were we have save the certificate> -keystore "<path for the cacerts file>" -storepass changeit



For Me the Command Will Be:

Java
 




xxxxxxxxxx
1


 
1
keytool -importcert -trustcacerts -alias repo -file C:\Users\DELL\Desktop\repo.cer -keystore " C:\Program Files\Java\jdk1.8.0_131\jre\lib\security\carcets " -storepass changeit



Note:

1. I am using jdk1.8.0_131 so the cacerts file path for my system is "C:\Program Files\Java\jdk1.8.0_131\jre\lib\security\carcets". It may differ for you based on your system and jdk version.

2. I have given the alias name as repo and the path where I save my certificate is C:\Users\DELL\Desktop\repo.cer


To Install the Certificate, Follow the Below Steps:

1. Open Command Prompt as an Administrator and use the command for installation and press enter. Open Command Prompt

2. Once the command is executed, it will ask for confirmation. Write Yes and the certificate will be installed with a confirmation.Command asking for confirmation

Successful Confirmation

In the above process, we have downloaded and installed the certificate successfully in our system.

Now if we will execute the application it will not show certificate issues and will also download the required data from that particular system.

Firewall (computing) security

Published at DZone with permission of Abhishek Bathwal. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • The Relationship Between Performance and Security
  • How To Learn Cyber Security Step-by-Step
  • 5 Common Firewall Misconfigurations and How to Address Them
  • Security Architecture Review on a SASE Solution

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook