# Katalon WS API request with host, certificate and private key

**URL:** <https://forum.katalon.com/t/katalon-ws-api-request-with-host-certificate-and-private-key/41720>\
**Category:** API Testing\
**Tags:** api-testing, katalon-studio\
**Created:** [March 31, 2020, 2:10pm UTC](https://forum.katalon.com/t/katalon-ws-api-request-with-host-certificate-and-private-key/41720 "2020-03-31T14:10:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vitallica](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/vitallica/32/16104_2.png) [@Vitallica](https://forum.katalon.com/u/Vitallica)\
**Post date:** [March 31, 2020, 2:10pm UTC](https://forum.katalon.com/t/katalon-ws-api-request-with-host-certificate-and-private-key/41720/1 "2020-03-31T14:10:40Z")

</div>

HI,

Is there any way to set a host, certificate and private key file for WS API test object in Katalon?  
In Postman those are in the Settings - Certificates  
Host  
CRT file  
KEY file  
Passphrase

Thank you.

---

<div class="post-metadata">

**Author:** ![Igi\_PL](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/igi_pl/32/1083_2.png) [@Igi\_PL](https://forum.katalon.com/u/Igi_PL)\
**Post date:** [March 31, 2020, 4:20pm UTC](https://forum.katalon.com/t/katalon-ws-api-request-with-host-certificate-and-private-key/41720/2 "2020-03-31T16:20:49Z")

</div>

Hi,

Mutual TLC is supported only in Enterprice version [How to set a certificate for a API request](http://forum.katalon.com/t/how-to-set-a-certificate-for-a-api-request/10377/) ☹

---

<div class="post-metadata">

**Author:** ![Vitallica](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/vitallica/32/16104_2.png) [@Vitallica](https://forum.katalon.com/u/Vitallica)\
**Post date:** [March 31, 2020, 4:36pm UTC](https://forum.katalon.com/t/katalon-ws-api-request-with-host-certificate-and-private-key/41720/3 "2020-03-31T16:36:42Z")

</div>

![image](https://europe1.discourse-cdn.com/katalon/original/2X/b/b0d40ca5b126a71187a004ce7f1ef5e053d6a276.png)

This one?  
Or that one that starts from a command line?

---

<div class="post-metadata">

**Author:** ![Vitallica](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/vitallica/32/16104_2.png) [@Vitallica](https://forum.katalon.com/u/Vitallica)\
**Post date:** [March 31, 2020, 4:55pm UTC](https://forum.katalon.com/t/katalon-ws-api-request-with-host-certificate-and-private-key/41720/4 "2020-03-31T16:55:51Z")

</div>

I have tried to solve the issue in the next way

add a key file here

 ![image](https://europe1.discourse-cdn.com/katalon/original/2X/7/7c24673c5a93931ff118a6ef834820834b26b059.png)

import the .crt file here  
..]Katalon\_Studio\_Engine\_Windows\_64-7.2.1\jre\lib\security\cacerts

ERROR: Can’t build keystore: [Certificate chain missing]

if I put the .crt file in the Project - Settings - Network - Keystore  
and add something like this to a test case  
System.setProperty(‘javax.net.ssl.trustStore’, GlobalVariable.ssl\_key\_file)  
System.setProperty(‘javax.net.ssl.trustStorePassword’, GlobalVariable.ssl\_key\_pathphrase)  
request\_result = WS.sendRequest(findTestObject(‘API/connection\_check’), FailureHandling.STOP\_ON\_FAILURE)

I will get the next  
ERROR: Can’t build keystore: [Private key missing (bad password?)]

---

<div class="post-metadata">

**Author:** ![huynguyen](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/huynguyen/32/552_2.png) [@huynguyen](https://forum.katalon.com/u/huynguyen)\
**Post date:** [April 1, 2020, 8:21am UTC](https://forum.katalon.com/t/katalon-ws-api-request-with-host-certificate-and-private-key/41720/5 "2020-04-01T08:21:12Z")

</div>

Hi @Vitallica,  
Please generate a KeyStore file from your cert file and key file, then apply it to client certificate settings. Please follow the documentation here [https://docs.katalon.com/katalon-studio/docs/execution-settings.html#client-certificate-settings](https://docs.katalon.com/katalon-studio/docs/execution-settings.html#client-certificate-settings)

---

<div class="post-metadata">

**Author:** ![Vitallica](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/vitallica/32/16104_2.png) [@Vitallica](https://forum.katalon.com/u/Vitallica)\
**Post date:** [April 1, 2020, 8:27am UTC](https://forum.katalon.com/t/katalon-ws-api-request-with-host-certificate-and-private-key/41720/6 "2020-04-01T08:27:24Z")

</div>

Thanks, I will try

---

<div class="post-metadata">

**Author:** ![Vitallica](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/vitallica/32/16104_2.png) [@Vitallica](https://forum.katalon.com/u/Vitallica)\
**Post date:** [August 1, 2022, 11:25am UTC](https://forum.katalon.com/t/katalon-ws-api-request-with-host-certificate-and-private-key/41720/7 "2022-08-01T11:25:01Z")

</div>

Is there any chance to set the KeyStore path as a variable?  
The Katalon documentation said:  
Katalon Studio can be configured to use the Client Certificate for all requests. To sign all the requests from Katalon Studio, specify the full path to your KeyStore file and the KeyStore Password. The recommended key store format is **PKCS #12** (.p12).  
My company has different environments and keys respectively, so it is really annoying process to change the path every time in the Project Settings Network.

It would be much easier if the path set in the Profile and use a variable in the Network KeyStore.

Thanks.
