ftos.utils.getCertificate
IMPORTANT!
Starting with v24.3, this is renamed from server.clientCertificates.get to ftos.utils.getCertificate.
Starting with v24.3, this is renamed from server.clientCertificates.get to ftos.utils.getCertificate.
Returns a registered TLS client certificate. For information on how to register client certificates, see the Studio documentation.
This is suitable for all modules of business service components.
Syntax
function ftos.utils.getCertificate(certificateName: string): WorkflowClientCertificate
| Parameter | Description |
|---|---|
certificateName
|
Name of the client certificate registered int the web.config configuration file. |
Return Value
Returns a JSON object containing the client certificate specifications. The object can be used as an optional parameter in httpGet and httpPost functions to run requests to web services that require TLS authentication.
Examples
In this example:
- We retreive the clientCert1 certificate (that has been registered in the web.config configuration file) in a variable called cert.
- We run an HTTP Post request to the https://server.com/route2 server with the myPostData payload using the certificate. For details on how to run HTTP Post requests, see httpPost.
- We store the request response in the postResult variable.
var cert = ftos.utils.getCertificate('clientCert1');
var postResult = httpPost('https://server.com/route2', myPostData, {clientCertificate: cert});