Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
kikiram
Contributor II
Contributor II

Qliksense License Addition Process

I have installed Qliksense using silent installer methods, Now I'm trying to add license via CLI, while hitting qrs api https://localhost:4242/qrs/about?xrfkey=1234567890qazxsw ending up with "The request was aborted: Could not create SSL/TLS secure channel." Even after exporting all (client.pem, client_key.pem, root.pem) the certificates from .Local Certificate into client.pfx

I'm using latest license version (Signed License Key) Model.

@qlik@qliksense   Also I couldn't find any document to automate License addition process for latest version as such Qlik Sense: How to automate the installation and configuration with commands and APIs

Labels (1)
4 Replies
Maria_Halley
Support
Support

kikiram
Contributor II
Contributor II
Author

Thanks for sharing the doc. I attempted to use the following command to access the URI:
 
 Invoke-RestMethod -Uri "https://$qlikServer/qrs/license?privileges=true" `
 -Method POST `
 -Body $body `
 

 where $body = @{ key = $slk } | ConvertTo-Json

However, I received the following error:
Invoke-RestMethod :
400 - Bad Request - Qlik Sense

Note : It also throws same response with header, 
$headers = @{    "Content-Type" = "application/json" }
kikiram
Contributor II
Contributor II
Author

Also it would be helpful if any other ways to activate SLK with qlik-cli 

 

Levi_Turner
Employee
Employee

Reference code which works on May 2025 (I doubt this varies between versions):

$hdrs = @{}
$hdrs.Add("X-Qlik-Xrfkey","examplexrfkey123")
$hdrs.Add("X-Qlik-User", "UserDirectory=QMI-QS-d208; UserId=qmi")
# Grab the Client certificate to trust the QRS request
$cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where {$_.Subject -like '*QlikClient*'}
# Construct the FQDN
# Use case is being run on the Qlik Sense Server
$Data = Get-Content C:\ProgramData\Qlik\Sense\Host.cfg
# Convert the base64 encoded install name for Sense to UTF data
$FQDN = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($($Data)))
# Construct the body for the POST request
$body = '{"key":"eyJhb"}'
# Handle TLS 1.2 only environments
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]'Ssl3,Tls,Tls11,Tls12'
Invoke-RestMethod -Uri "https://$($FQDN):4242/qrs/license?xrfkey=examplexrfkey123" -Method Post -Body $body -Headers $hdrs -ContentType 'application/json' -Certificate $cert

 

Notes of configurable values:
Line 3: I'd use whatever user you intend to log in. Upon licensing Qlik Sense Enterprise - Client Managed, the user who licenses the cluster is made a RootAdmin. Do cmd.exe > whoami to determine the account that you're interactively logging in as

Line 12: Obviously specify your SLK here.