KRE Docker Agent Unable to Access Internal Website - Returns Empty HTML

Hi everyone,

I’m currently working with KRE in Docker as an agent, and we’re having some trouble accessing an internal URL. We have a URL “https://internal.example.com” that is only reachable via VPN, and the Docker is hosted on the same machine as the VPN. When we make a curl request for the URL, we receive the page and its content inside the container. However, when we launch and execute WebUI.openBrowser('https://internal.example.com') in Katalon, it returns an empty HTML page. Additionally, when we turn off the VPN, we receive an error message that the URL is unreachable. We’ve also tested the same code for a public DNS (WebUI.openBrowser('https://google.com')) and it works as expected.

We’re currently using version 8.5.5 of KRE and the webdriver, and Chrome 112. We’re not sure why the internal website returns an empty HTML page, even though the curl request works fine. Do we need to add something?

Any help would be greatly appreciated! Thank you.

Hi @nladib, not an expert on your issue but these may help:

https://www.phind.com/search?cache=0efeaa02-3687-465d-a233-2c26621796ee

https://www.phind.com/search?cache=8643edcc-afc2-4c6a-bfeb-ab505b68b3ab

https://www.phind.com/search?cache=7fb6a296-2ebc-41f2-b818-65a761c24d16

Try your own www.phind.com searches

Thank you for your reply, but the curl command in the Docker image also works and returns the HTML pages correctly. On the other hand, when running the automated test containing WebUI.openBrowser('https://internal.example.com') , KRE returns an empty HTML page.
I appreciate your help.

[Problem]: I am working with on-premise resources that are not accessible publicly. I am running automation tests with Katalon Runtime Engine (KRE) in Docker, but the Chrome driver and KRE are not recognizing the internal certificates installed on the same VM. I want to make Katalon Studio recognize and trust these internal certificates.

[Solution]: To resolve this issue, I need to add the internal certificates to the Java keystore used by Katalon Studio and configure Katalon Studio to use the updated keystore. Here’s a step-by-step guide:

  1. Export the internal certificate to a .pem or .cer file format:

I can use the following command to export the certificate:

openssl s_client -connect my_domain:port -showcerts </dev/null 2>/dev/null | openssl x509 -outform PEM > my_certificate.pem

Replace “my_domain” with my internal domain, “port” with the corresponding port number, and “my_certificate.pem” with my desired output file name.

  1. Add the certificate to the Docker image:

Since I am running KRE in Docker, I need to add the exported certificate file to my Docker image. I can do this by creating a new Dockerfile or modifying an existing one to include the following lines:

COPY my_certificate.pem /path/to/certificates/

Replace “/path/to/certificates/” with the desired directory within the Docker image where I want to store the certificate.

  1. Locate the Java cacerts file:

Find the Java installation directory used by Katalon Studio within the Docker image. Once I’ve identified the Java version, I can locate the jre/lib/security/cacerts file within the Java installation directory.

  1. Import the certificate into the Java keystore:

In the Dockerfile, add a command to import the exported certificate into the Java keystore:

RUN keytool -import -alias my_alias -file /path/to/certificates/my_certificate.pem -keystore path_to_your_cacerts_file -storepass changeit -noprompt

Replace “my_alias” with a unique alias for the certificate, “/path/to/certificates/my_certificate.pem” with the path to the certificate within the Docker image, and “path_to_your_cacerts_file” with the path to the cacerts file I located earlier.

  1. Configure Katalon Studio to use the updated keystore:

Add the following JVM options to my katalon.ini or katalon.properties file:

xms=512m
xmx=4096m
Djavax.net.ssl.trustStore=path_to_your_cacerts_file
Djavax.net.ssl.trustStorePassword=your_keystore_password

Replace “path_to_your_cacerts_file” with the path to the cacerts file where I imported the certificate, and “your_keystore_password” with the password for the keystore (by default, it is changeit).

  1. Rebuild the Docker image:

Rebuild the Docker image using the updated Dockerfile. This will include the internal certificate in the Java keystore used by Katalon Studio.

  1. Re-run my tests:

After completing these steps, Katalon Studio should recognize my internal certificates. I can re-run my tests and check if the issue is resolved.