<?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>article Qlik Replicate: LINUX SSL setup for DB2i connection in Official Support Articles</title>
    <link>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Replicate-LINUX-SSL-setup-for-DB2i-connection/ta-p/1730011</link>
    <description>&lt;DIV class="lia-message-template-content-zone"&gt;
&lt;P&gt;&lt;SPAN&gt;TLS communication is not natively supported by IBM's ODBC iSeries driver. This however can be accomplished using &lt;A href="https://www.stunnel.org/index.html" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;S&lt;/STRONG&gt;&lt;/A&gt;&lt;A href="https://www.stunnel.org/index.html" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;tunnel&lt;/STRONG&gt;&lt;/A&gt;.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Index:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-TOC indent="15" liststyle="none" maxheadinglevel="4"&gt;&lt;/LI-TOC&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Overview&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Stunnel&lt;/FONT&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;is a proxy designed to add TLS encryption functionality to existing clients and servers without changing the programs' code. Its architecture is optimized for security, portability, and scalability (including load balancing), making it suitable for large deployments.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Once the&amp;nbsp;&lt;/SPAN&gt;Stunnel&amp;nbsp;&lt;SPAN&gt;is installed, its time to configure different system components. The steps can be summarized as below:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;/etc/hosts&lt;/FONT&gt;: define local hosts for&lt;SPAN&gt;&amp;nbsp;s&lt;/SPAN&gt;tunnel&amp;nbsp;to listen to (one for each source Database. If the same DB is used with different journals, you will need only one connection.&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;iSeries.stunnel.config:&lt;/FONT&gt; define the port forwarding on the local machine. The target port should always be &lt;FONT face="courier new,courier"&gt;9471&lt;/FONT&gt;. The local port can be configured as desired.&lt;/LI&gt;
&lt;LI&gt;Configure &lt;FONT face="courier new,courier"&gt;ODBC.INI&lt;/FONT&gt; to define DNSs for every connection/DB.&lt;/LI&gt;
&lt;LI&gt;Configure the Qlik Replicate task.&lt;/LI&gt;
&lt;/OL&gt;
&lt;BLOCKQUOTE&gt;&lt;SPAN&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; You can always test from Linux with isql delivered with the unixODBC.&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="David_Fergen_0-1595440217406.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/37894i0961539E13A745B1/image-size/large?v=v2&amp;amp;px=999" role="button" title="David_Fergen_0-1595440217406.png" alt="David_Fergen_0-1595440217406.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Prerequisites&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;&lt;SPAN&gt;The following prerequisites must be met:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;OL class="lia-list-style-type-lower-alpha"&gt;
&lt;LI&gt;Secure Connection ports must be open between the Replicate Server and iSeries partition of interest:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://www-01.ibm.com/support/docview.wss?uid=nas8N1018654" target="_blank" rel="noopener"&gt;http://www-01.ibm.com/support/docview.wss?uid=nas8N1018654&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;SSL is enabled on iSeries side to allow secure connections.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;Service accounts with corresponding privileges should be defined on iSeries to allow connection from Qlik Replicate.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;The user needs to obtain an SSL certificate in PEM format. If provided in a different format, a certificate can be converted to the desired one. See &lt;A href="http://&amp;nbsp;https://serverfault.com/questions/254627/how-do-i-convert-a-cer-certificate-to-pem" target="_blank" rel="noopener"&gt;this page&lt;/A&gt; for instructions.&lt;BR /&gt;&lt;BR /&gt;Sample command:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;$ openssl x509 -inform der -in certificate.cer -outform pem -out certificate.pem&lt;BR /&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;The stunnel software needs to be installed on a Linux machine where Qlik Replicate is running&lt;BR /&gt;&lt;BR /&gt;Sample command:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;$ yum install stunnel​&lt;/FONT&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Setup&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H3&gt;
&lt;H4&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Configure /etc/hosts&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;&lt;SPAN&gt;Define local IPs and corresponding DSNs in the &lt;FONT face="courier new,courier"&gt;/etc/hosts,&lt;/FONT&gt; as shown in the example below:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;127.0.0.1&amp;nbsp;&amp;nbsp; localhost localhost.domain&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;EM&gt;127.0.0.11&amp;nbsp; DBSSL1.localhost&lt;BR /&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;EM&gt;127.0.0.12&amp;nbsp; DBSSL2.localhost&lt;BR /&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;127.0.0.13&amp;nbsp; DBSSL3.localhost&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Configure stunnel&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;OL&gt;
&lt;LI&gt;Convert the PEM certificate received from iSeries administrator to text file.&lt;BR /&gt;
&lt;P&gt;&lt;BR /&gt;Do this by cat.. command and copy the contents to a text file:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;cat certificate.pem &amp;gt; certificate.txt&lt;/FONT&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;Edit the &lt;FONT face="courier new,courier"&gt;iaccess.stunnel.config&lt;/FONT&gt; file:&lt;BR /&gt;&lt;BR /&gt;
&lt;OL class="lia-list-style-type-lower-alpha"&gt;
&lt;LI&gt;Modify each &lt;FONT face="courier new,courier"&gt;accept=&lt;/FONT&gt; line to contain a unique local address and port, as defined in the &lt;FONT face="courier new,courier"&gt;/etc/hosts&lt;/FONT&gt; and the standard non-secure connection port (&lt;FONT face="courier new,courier"&gt;8471&lt;/FONT&gt;)&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Modify each &lt;FONT face="courier new,courier"&gt;connect=&lt;/FONT&gt; line with your IBMi system name pointing to a secure port &lt;FONT face="courier new,courier"&gt;9471&lt;BR /&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Set &lt;FONT face="courier new,courier"&gt;CAFile&lt;/FONT&gt; to the path of the certificate text file.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;Example:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;CAFile = /tmp/certificate.txt&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;# Used for ODBC (isql, ...)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;[as-database]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;accept = &lt;STRONG&gt;DBSSL1.localhost&lt;/STRONG&gt;:8471&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;connect = remotedb1.domain:9471&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;[as-database]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;accept = &lt;STRONG&gt;DBSSL2.localhost&lt;/STRONG&gt;:8471&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;connect = remotedb2.domain:9471&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;[as-database]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;accept = &lt;STRONG&gt;DBSSL3.localhost&lt;/STRONG&gt;:8471&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;connect = remotedb3.domain:9471&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;Run stunnel with root user: &lt;FONT face="courier new,courier"&gt;stunnel &amp;lt;CONFIG_FILE_PATH&amp;gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;May need to be registered as a service to start up with the server. Without the stunnel software, the connections to iSeries will not work.&lt;/LI&gt;
&lt;/OL&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;DIV&gt;
&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;H4&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Configure the odbc.ini&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;&lt;SPAN&gt;Configure &lt;FONT face="courier new,courier"&gt;odbc.ini&lt;/FONT&gt; for the SSL-enabled instances. See the example below:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;[DBSSL1] &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;DRIVER=IBM i Access ODBC Driver 64-bit &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;SYSTEM=&lt;STRONG&gt;DBSSL1.localhost&amp;nbsp;&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; *&lt;EM&gt;The local address defined in odbc.ini&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;QRYSTGLMT=*NOMAX &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;QUERYTIMEOUT=0 &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;BLOCKFETCH=1 &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;BLOCKSIZE=8192 &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;COMPRESSION=1 &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;TRACE=0 &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;SSL=1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;**&lt;EM&gt;So far appears to do nothing but document the fact that the connection is secure&lt;/EM&gt;&lt;/FONT&gt;&lt;STRONG style="font-family: inherit;"&gt;&lt;FONT size="4"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;STRONG style="font-family: inherit;"&gt;&lt;FONT size="4"&gt;Configuring the Qlik Replicate Endpoint&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The DB2i endpoint should be configured in Qlik Replicate. The option discussed in this document is to use the&amp;nbsp;&lt;FONT face="courier new,courier"&gt;odbc.ini&lt;/FONT&gt; defined in the DSN, nevertheless, a “Use connection properties” option could also be used pointing to &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;DBSSAL1.localhost&lt;/FONT&gt;&lt;/STRONG&gt;, just like in &lt;FONT face="courier new,courier"&gt;odbc.ini&lt;/FONT&gt;:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Use ODBC DSN.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/99415iE35145A773E09A2E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Use ODBC DSN.png" alt="Use ODBC DSN.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Validation&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;&lt;SPAN&gt;Several steps can be taken to validate whether the connection is secure:&lt;/SPAN&gt;&lt;/P&gt;
&lt;H4&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Trace outbound communications from Linux server&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;&lt;SPAN&gt;A &lt;FONT face="courier new,courier"&gt;tcpdump&lt;/FONT&gt; command can be used to determine whether the communication is successfully leaving the server to the correct destination port:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;$ tcpdump -i eth2 `port 9471`&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Display iSeries job details&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;P&gt;&lt;SPAN&gt;Run the following command on the iSeries:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;WRKOBJLCK &lt;STRONG&gt;userid&lt;/STRONG&gt; *USRPRF ​&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This will display the jobs using the service account &lt;FONT face="courier new,courier"&gt;userid&lt;/FONT&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You may need to scroll down to see a &lt;FONT face="courier new,courier"&gt;QSQSRVR&lt;/FONT&gt; which is the initial connection job, there is not much information to be extracted from this job.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Below this, you will see a &lt;FONT face="courier new,courier"&gt;QZDAS&lt;FONT color="#339966"&gt;&lt;STRONG&gt;O&lt;/STRONG&gt;&lt;/FONT&gt;INIT&lt;/FONT&gt; and/or &lt;FONT face="courier new,courier"&gt;QZDAS&lt;STRONG&gt;&lt;FONT color="#339966"&gt;S&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/SPAN&gt;I&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;NIT &amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;O&lt;/STRONG&gt;&lt;/FONT&gt; = non-SSL connection (Port &lt;FONT face="courier new,courier"&gt;8471&lt;/FONT&gt;)&amp;nbsp;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;S&lt;/STRONG&gt;&lt;/FONT&gt; = SSL connection (Port &lt;FONT face="courier new,courier"&gt;9471&lt;/FONT&gt;)&lt;/DIV&gt;</description>
    <pubDate>Wed, 01 Feb 2023 12:26:05 GMT</pubDate>
    <dc:creator>David_Fergen</dc:creator>
    <dc:date>2023-02-01T12:26:05Z</dc:date>
    <item>
      <title>Qlik Replicate: LINUX SSL setup for DB2i connection</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Replicate-LINUX-SSL-setup-for-DB2i-connection/ta-p/1730011</link>
      <description>&lt;DIV class="lia-message-template-content-zone"&gt;
&lt;P&gt;&lt;SPAN&gt;TLS communication is not natively supported by IBM's ODBC iSeries driver. This however can be accomplished using &lt;A href="https://www.stunnel.org/index.html" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;S&lt;/STRONG&gt;&lt;/A&gt;&lt;A href="https://www.stunnel.org/index.html" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;tunnel&lt;/STRONG&gt;&lt;/A&gt;.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Index:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-TOC indent="15" liststyle="none" maxheadinglevel="4"&gt;&lt;/LI-TOC&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Overview&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Stunnel&lt;/FONT&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;is a proxy designed to add TLS encryption functionality to existing clients and servers without changing the programs' code. Its architecture is optimized for security, portability, and scalability (including load balancing), making it suitable for large deployments.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Once the&amp;nbsp;&lt;/SPAN&gt;Stunnel&amp;nbsp;&lt;SPAN&gt;is installed, its time to configure different system components. The steps can be summarized as below:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;/etc/hosts&lt;/FONT&gt;: define local hosts for&lt;SPAN&gt;&amp;nbsp;s&lt;/SPAN&gt;tunnel&amp;nbsp;to listen to (one for each source Database. If the same DB is used with different journals, you will need only one connection.&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;iSeries.stunnel.config:&lt;/FONT&gt; define the port forwarding on the local machine. The target port should always be &lt;FONT face="courier new,courier"&gt;9471&lt;/FONT&gt;. The local port can be configured as desired.&lt;/LI&gt;
&lt;LI&gt;Configure &lt;FONT face="courier new,courier"&gt;ODBC.INI&lt;/FONT&gt; to define DNSs for every connection/DB.&lt;/LI&gt;
&lt;LI&gt;Configure the Qlik Replicate task.&lt;/LI&gt;
&lt;/OL&gt;
&lt;BLOCKQUOTE&gt;&lt;SPAN&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; You can always test from Linux with isql delivered with the unixODBC.&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="David_Fergen_0-1595440217406.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/37894i0961539E13A745B1/image-size/large?v=v2&amp;amp;px=999" role="button" title="David_Fergen_0-1595440217406.png" alt="David_Fergen_0-1595440217406.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Prerequisites&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;&lt;SPAN&gt;The following prerequisites must be met:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;OL class="lia-list-style-type-lower-alpha"&gt;
&lt;LI&gt;Secure Connection ports must be open between the Replicate Server and iSeries partition of interest:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://www-01.ibm.com/support/docview.wss?uid=nas8N1018654" target="_blank" rel="noopener"&gt;http://www-01.ibm.com/support/docview.wss?uid=nas8N1018654&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;SSL is enabled on iSeries side to allow secure connections.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;Service accounts with corresponding privileges should be defined on iSeries to allow connection from Qlik Replicate.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;The user needs to obtain an SSL certificate in PEM format. If provided in a different format, a certificate can be converted to the desired one. See &lt;A href="http://&amp;nbsp;https://serverfault.com/questions/254627/how-do-i-convert-a-cer-certificate-to-pem" target="_blank" rel="noopener"&gt;this page&lt;/A&gt; for instructions.&lt;BR /&gt;&lt;BR /&gt;Sample command:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;$ openssl x509 -inform der -in certificate.cer -outform pem -out certificate.pem&lt;BR /&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;The stunnel software needs to be installed on a Linux machine where Qlik Replicate is running&lt;BR /&gt;&lt;BR /&gt;Sample command:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;$ yum install stunnel​&lt;/FONT&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Setup&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H3&gt;
&lt;H4&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Configure /etc/hosts&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;&lt;SPAN&gt;Define local IPs and corresponding DSNs in the &lt;FONT face="courier new,courier"&gt;/etc/hosts,&lt;/FONT&gt; as shown in the example below:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;127.0.0.1&amp;nbsp;&amp;nbsp; localhost localhost.domain&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;EM&gt;127.0.0.11&amp;nbsp; DBSSL1.localhost&lt;BR /&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;EM&gt;127.0.0.12&amp;nbsp; DBSSL2.localhost&lt;BR /&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;127.0.0.13&amp;nbsp; DBSSL3.localhost&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Configure stunnel&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;OL&gt;
&lt;LI&gt;Convert the PEM certificate received from iSeries administrator to text file.&lt;BR /&gt;
&lt;P&gt;&lt;BR /&gt;Do this by cat.. command and copy the contents to a text file:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;cat certificate.pem &amp;gt; certificate.txt&lt;/FONT&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;Edit the &lt;FONT face="courier new,courier"&gt;iaccess.stunnel.config&lt;/FONT&gt; file:&lt;BR /&gt;&lt;BR /&gt;
&lt;OL class="lia-list-style-type-lower-alpha"&gt;
&lt;LI&gt;Modify each &lt;FONT face="courier new,courier"&gt;accept=&lt;/FONT&gt; line to contain a unique local address and port, as defined in the &lt;FONT face="courier new,courier"&gt;/etc/hosts&lt;/FONT&gt; and the standard non-secure connection port (&lt;FONT face="courier new,courier"&gt;8471&lt;/FONT&gt;)&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Modify each &lt;FONT face="courier new,courier"&gt;connect=&lt;/FONT&gt; line with your IBMi system name pointing to a secure port &lt;FONT face="courier new,courier"&gt;9471&lt;BR /&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Set &lt;FONT face="courier new,courier"&gt;CAFile&lt;/FONT&gt; to the path of the certificate text file.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;Example:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;CAFile = /tmp/certificate.txt&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;# Used for ODBC (isql, ...)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;[as-database]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;accept = &lt;STRONG&gt;DBSSL1.localhost&lt;/STRONG&gt;:8471&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;connect = remotedb1.domain:9471&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;[as-database]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;accept = &lt;STRONG&gt;DBSSL2.localhost&lt;/STRONG&gt;:8471&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;connect = remotedb2.domain:9471&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;[as-database]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;accept = &lt;STRONG&gt;DBSSL3.localhost&lt;/STRONG&gt;:8471&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;connect = remotedb3.domain:9471&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;Run stunnel with root user: &lt;FONT face="courier new,courier"&gt;stunnel &amp;lt;CONFIG_FILE_PATH&amp;gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;May need to be registered as a service to start up with the server. Without the stunnel software, the connections to iSeries will not work.&lt;/LI&gt;
&lt;/OL&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;DIV&gt;
&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;H4&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Configure the odbc.ini&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;&lt;SPAN&gt;Configure &lt;FONT face="courier new,courier"&gt;odbc.ini&lt;/FONT&gt; for the SSL-enabled instances. See the example below:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;[DBSSL1] &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;DRIVER=IBM i Access ODBC Driver 64-bit &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;SYSTEM=&lt;STRONG&gt;DBSSL1.localhost&amp;nbsp;&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; *&lt;EM&gt;The local address defined in odbc.ini&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;QRYSTGLMT=*NOMAX &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;QUERYTIMEOUT=0 &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;BLOCKFETCH=1 &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;BLOCKSIZE=8192 &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;COMPRESSION=1 &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;TRACE=0 &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;SSL=1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;**&lt;EM&gt;So far appears to do nothing but document the fact that the connection is secure&lt;/EM&gt;&lt;/FONT&gt;&lt;STRONG style="font-family: inherit;"&gt;&lt;FONT size="4"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;STRONG style="font-family: inherit;"&gt;&lt;FONT size="4"&gt;Configuring the Qlik Replicate Endpoint&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The DB2i endpoint should be configured in Qlik Replicate. The option discussed in this document is to use the&amp;nbsp;&lt;FONT face="courier new,courier"&gt;odbc.ini&lt;/FONT&gt; defined in the DSN, nevertheless, a “Use connection properties” option could also be used pointing to &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;DBSSAL1.localhost&lt;/FONT&gt;&lt;/STRONG&gt;, just like in &lt;FONT face="courier new,courier"&gt;odbc.ini&lt;/FONT&gt;:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Use ODBC DSN.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/99415iE35145A773E09A2E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Use ODBC DSN.png" alt="Use ODBC DSN.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Validation&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;&lt;SPAN&gt;Several steps can be taken to validate whether the connection is secure:&lt;/SPAN&gt;&lt;/P&gt;
&lt;H4&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Trace outbound communications from Linux server&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;&lt;SPAN&gt;A &lt;FONT face="courier new,courier"&gt;tcpdump&lt;/FONT&gt; command can be used to determine whether the communication is successfully leaving the server to the correct destination port:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;$ tcpdump -i eth2 `port 9471`&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Display iSeries job details&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;P&gt;&lt;SPAN&gt;Run the following command on the iSeries:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;WRKOBJLCK &lt;STRONG&gt;userid&lt;/STRONG&gt; *USRPRF ​&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This will display the jobs using the service account &lt;FONT face="courier new,courier"&gt;userid&lt;/FONT&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You may need to scroll down to see a &lt;FONT face="courier new,courier"&gt;QSQSRVR&lt;/FONT&gt; which is the initial connection job, there is not much information to be extracted from this job.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Below this, you will see a &lt;FONT face="courier new,courier"&gt;QZDAS&lt;FONT color="#339966"&gt;&lt;STRONG&gt;O&lt;/STRONG&gt;&lt;/FONT&gt;INIT&lt;/FONT&gt; and/or &lt;FONT face="courier new,courier"&gt;QZDAS&lt;STRONG&gt;&lt;FONT color="#339966"&gt;S&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/SPAN&gt;I&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;NIT &amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;O&lt;/STRONG&gt;&lt;/FONT&gt; = non-SSL connection (Port &lt;FONT face="courier new,courier"&gt;8471&lt;/FONT&gt;)&amp;nbsp;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;S&lt;/STRONG&gt;&lt;/FONT&gt; = SSL connection (Port &lt;FONT face="courier new,courier"&gt;9471&lt;/FONT&gt;)&lt;/DIV&gt;</description>
      <pubDate>Wed, 01 Feb 2023 12:26:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Replicate-LINUX-SSL-setup-for-DB2i-connection/ta-p/1730011</guid>
      <dc:creator>David_Fergen</dc:creator>
      <dc:date>2023-02-01T12:26:05Z</dc:date>
    </item>
  </channel>
</rss>

