Documentation

Looking for something in particular?

How to Use Keytool Command for Importing Certificates

Summary: Sending requests from Provar Automation to any website could cause potential errors if the certificates of that website URL are not present in the Java CAcert file.

For example, the Provar license server has two URLs: https://prod.provar.cloud/licensing/algas/ and https://staging.provar.cloud/licensing/algas/. If you get errors like PKIX build path issue or license server is not available while activating or testing your License key, you probably need to download the certificates for these two URLs and those certificates in the file CAcerts.

To resolve this issue we need to perform the following steps:

  1. Download the certificates from the launching URL. Open your desired URL in the browser you are trying to communicate with. In our case, It is the Provar License URL.

Once the page is loaded, download the certificate from this URL. Click on the icon view site information. Click connection is secure.

Then click the Certificate is valid text. Inn the upcoming window click the Details tab and click the Export button.

After clicking the Export button, save the file to your desired location. Note: do not change the file name and its extension while saving it. You will receive a certificate file which looks like this:

2. Import the certificate to CAcerts file.

The first location of cacerts is the Provar Installation directory which is in my case is this path – C:\Program Files\Provarv2.12.2\jre\lib\security\cacerts

The second  path of cacerts is within you default JAVA installation directory which is in my case- C:\Program Files\Amazon Corretto\jdk11.0.20_8\lib\security\cacerts

Now we need a command which we use to add certificates in these CAcerts:

keytool -import -noprompt -trustcacerts -alias myFancyAlias -file “/path/to/my/cert/myCert.cer” -keystore “/path/to/my/jdk/jre/lib/security/cacerts” -storepass changeit

Run this command in Command Prompt(CMD) which is open in Administrative Mode. 

In this above command, we are providing two file paths in double quotes (“”) the first file path refers to the certificate which you have downloaded and the second file path refers to the CAcerts file.

Change this according to these paths according to your system and run this command.

Note:

In our command, there is an alias used, so always use a new alias when you are running the command.

Keep Provar Automation closed while running this command.

If you have multiple URLs, do all the above-mentioned steps. If you want to import certificates in a running docker container refer to this information.


Feedback

Was this article helpful for you?
Documentation library

Trying to raise a case with our support team?

We use cookies to better understand how our website is used so we can tailor content for you. For more information about the different cookies we use please take a look at our Privacy Policy.

Scroll to Top