Register TLS Client Certificates
Client certificates allow you to access web services that require client authentication via the TLS/SSL protocol. Once a certificate is registered, you can refer it in your server side scripts and include it in API calls.
To register a TLS Client Certificate add the following key to the <appSettings>
node in the FintechOS Studio web.config file:
<appSettings>
...
<add key="automation-client-certificate-clientCert1" value="{ 'storeName': 'My', 'storeLocation': 'LocalMachine', 'thumbPrint': 'd77621fa50114404a6e5820c6d066b019c13fdd8', 'description':'Client certificate for Api1' }">
or
<add key="automation-client-certificate-clientCert1" value="{ 'storeName': 'My', 'storeLocation': 'LocalMachine', 'thumbPrint': 'd77621fa50114404a6e5820c6d066b019c13fdd8', 'description':'Client certificate for Api1 a' }">
...
</appSettings>
You must provide a programmatic name, preceded by the automation-client-certificate-
prefix. For instance, in the example above, the name of the client certificate is going to be clientCert1.
The value is provided in JSON format and must be XML escaped. For simpler scenarios you can use single quotes instead of double quotes. The JSON value has the following structure:
{
"storeName": "My",
"storeLocation": "LocalMachine",
"thumbPrint": "d77621fa50114404a6e5820c6d066b019c13fdd8",
"description": "Client certificate for Api1",
"checkValidity": true
}
Property | Description |
---|---|
storeName
|
You can populate the storeName property with one of the following values:
|
storeLocation
|
You can populate the storeLocation property with one of the following values:
|
thumbPrint
|
This is the thumbprint of the client certificate. |
description
|
A user-friendly description of the certificate. This information will be displayed in the code editor's intelligent code completion suggestions. |
checkValidity
|
|
Usage in server-side scripts
The automation API supports referencing client certificates and passing them in the httpGet/httpPost functions. For more information, see the Server SDK Reference Guide documentation.
var cert = server.clientCertificates.get('clientCert1');
var getResult = httpGet('https://server.com/route1', {}, {
clientCertificate: cert
});
var postResult = httpPost('https://server.com/route2', myPostData, {
clientCertificate: cert
});
In the code editor, the server.clientCertificates.get
function provides automatic code completion suggestions for the registered client certificates.