<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Can't connect to Qlik Engine websocket API using client certificates in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Can-t-connect-to-Qlik-Engine-websocket-API-using-client/m-p/1845440#M15718</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to establish a connection to the Qlik engine Websocket API. Referring here:&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/sense-developer/August2021/Subsystems/EngineAPI/Content/Sense_EngineAPI/GettingStarted/connecting-to-engine-api.htm" target="_blank" rel="noopener"&gt;https://help.qlik.com/en-US/sense-developer/August2021/Subsystems/EngineAPI/Content/Sense_EngineAPI/GettingStarted/connecting-to-engine-api.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I am trying to connect to QlikSense Enterprise from my local computer, using the certificates method. I received the root.pem, client.pem and client_key.pem files from our Qliksense admin. But whenever I am trying to connect, I am receiving this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Error: self signed certificate in certificate chain
    at TLSSocket.onConnectSecure (_tls_wrap.js:1515:34)
    at TLSSocket.emit (events.js:400:28)
    at TLSSocket._finishInit (_tls_wrap.js:937:8)
    at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:709:12) {
  code: 'SELF_SIGNED_CERT_IN_CHAIN'
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;This is the nodejs script which I am using:&lt;/P&gt;&lt;PRE&gt;const WebSocket = require('ws');
const path = require('path')
const fs = require('fs')

// Set certPath to the path to the directory that contains the exported client certificates in PEM format.
var certPath =  path.join('/local-path-to-pem-files/');

var certificates = {
	cert: fs.readFileSync(path.resolve(certPath, 'client.pem')),
	key: fs.readFileSync(path.resolve(certPath, 'client_key.pem')),
	root: fs.readFileSync(path.resolve(certPath, 'root.pem'))
	};

// Open a WebSocket using the engine port (rather than going through the proxy)
// We use the certificates and a built-in Qlik service account
// We connect at the global level, which gives access to APIs in the Global class

	const ws = new WebSocket('wss://&amp;lt;server-name&amp;gt;/app/', {
		ca: [certificates.root],
		cert: certificates.cert,
		key: certificates.key

	});
	
	 ws.onopen = function (event) {
		// send some message
	}
    ws.on('error', function(error) {
        console.log(error);
      });&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Is there anything I am missing? Can someone please help?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Fri, 15 Nov 2024 23:38:16 GMT</pubDate>
    <dc:creator>schatterjee</dc:creator>
    <dc:date>2024-11-15T23:38:16Z</dc:date>
    <item>
      <title>Can't connect to Qlik Engine websocket API using client certificates</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Can-t-connect-to-Qlik-Engine-websocket-API-using-client/m-p/1845440#M15718</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to establish a connection to the Qlik engine Websocket API. Referring here:&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/sense-developer/August2021/Subsystems/EngineAPI/Content/Sense_EngineAPI/GettingStarted/connecting-to-engine-api.htm" target="_blank" rel="noopener"&gt;https://help.qlik.com/en-US/sense-developer/August2021/Subsystems/EngineAPI/Content/Sense_EngineAPI/GettingStarted/connecting-to-engine-api.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I am trying to connect to QlikSense Enterprise from my local computer, using the certificates method. I received the root.pem, client.pem and client_key.pem files from our Qliksense admin. But whenever I am trying to connect, I am receiving this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Error: self signed certificate in certificate chain
    at TLSSocket.onConnectSecure (_tls_wrap.js:1515:34)
    at TLSSocket.emit (events.js:400:28)
    at TLSSocket._finishInit (_tls_wrap.js:937:8)
    at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:709:12) {
  code: 'SELF_SIGNED_CERT_IN_CHAIN'
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;This is the nodejs script which I am using:&lt;/P&gt;&lt;PRE&gt;const WebSocket = require('ws');
const path = require('path')
const fs = require('fs')

// Set certPath to the path to the directory that contains the exported client certificates in PEM format.
var certPath =  path.join('/local-path-to-pem-files/');

var certificates = {
	cert: fs.readFileSync(path.resolve(certPath, 'client.pem')),
	key: fs.readFileSync(path.resolve(certPath, 'client_key.pem')),
	root: fs.readFileSync(path.resolve(certPath, 'root.pem'))
	};

// Open a WebSocket using the engine port (rather than going through the proxy)
// We use the certificates and a built-in Qlik service account
// We connect at the global level, which gives access to APIs in the Global class

	const ws = new WebSocket('wss://&amp;lt;server-name&amp;gt;/app/', {
		ca: [certificates.root],
		cert: certificates.cert,
		key: certificates.key

	});
	
	 ws.onopen = function (event) {
		// send some message
	}
    ws.on('error', function(error) {
        console.log(error);
      });&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Is there anything I am missing? Can someone please help?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 23:38:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Can-t-connect-to-Qlik-Engine-websocket-API-using-client/m-p/1845440#M15718</guid>
      <dc:creator>schatterjee</dc:creator>
      <dc:date>2024-11-15T23:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: Can't connect to Qlik Engine websocket API using client certificates</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Can-t-connect-to-Qlik-Engine-websocket-API-using-client/m-p/1845470#M15719</link>
      <description>&lt;P&gt;I guess you need to allow for self signed certificates. There's a thread on the topic for node.js here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/45088006/nodejs-error-self-signed-certificate-in-certificate-chain" target="_blank"&gt;https://stackoverflow.com/questions/45088006/nodejs-error-self-signed-certificate-in-certificate-chain&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 11:13:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Can-t-connect-to-Qlik-Engine-websocket-API-using-client/m-p/1845470#M15719</guid>
      <dc:creator>Øystein_Kolsrud</dc:creator>
      <dc:date>2021-10-12T11:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: Can't connect to Qlik Engine websocket API using client certificates</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Can-t-connect-to-Qlik-Engine-websocket-API-using-client/m-p/1845603#M15722</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;I saw there is another way to authenticate JSON API, ie, using API key. Will it solve the same purpose? Is this method available for Qliksense Enterprise?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 14:09:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Can-t-connect-to-Qlik-Engine-websocket-API-using-client/m-p/1845603#M15722</guid>
      <dc:creator>schatterjee</dc:creator>
      <dc:date>2021-10-12T14:09:56Z</dc:date>
    </item>
  </channel>
</rss>

