<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>OpenText Analytics Database 26.2.x – TLS/SSL encryption with Kafka</title>
    <link>/en/kafka-integration/tlsssl-encryption-with-kafka/</link>
    <description>Recent content in TLS/SSL encryption with Kafka on OpenText Analytics Database 26.2.x</description>
    <generator>Hugo -- gohugo.io</generator>
    
	  <atom:link href="/en/kafka-integration/tlsssl-encryption-with-kafka/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Kafka-Integration: Planning TLS/SSL encryption between OpenText Analytics Database and Kafka</title>
      <link>/en/kafka-integration/tlsssl-encryption-with-kafka/planning-tlsssl-encryption-between-and-kafka/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/kafka-integration/tlsssl-encryption-with-kafka/planning-tlsssl-encryption-between-and-kafka/</guid>
      <description>
        
        
        &lt;p&gt;Some things to consider before you begin configuring TLS/SSL:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Which connections between the scheduler, OpenText™ Analytics Database, and Kafka needs to be encrypted? In some cases, you may only need to enable encryption between the database and Kafka. This scenario is common when the database and the Kafka cluster are on different networks. For example, suppose Kafka is hosted in a cloud provider and the database is hosted in your internal network. Then the data must travel across the unsecured Internet between the two. However, if the database and the scheduler are both in your local network, you may decide that configuring them to use SSL/TLS is unnecessary. In other cases, you will want all parts of the system to be encrypted. For example, you want to encrypt all traffic when Kafka, the database, and the scheduler are all hosted in a cloud provider whose network may not be secure.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Which connections between the scheduler, the database, and Kafka require trust? You can opt to have any of these connections fail if one system cannot verify the identity of another. See &lt;a href=&#34;#Ensuring&#34;&gt;Verifying Identities&lt;/a&gt; below.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Which CAs will you be using to sign each certificate? The simplest way to configure the scheduler, Kafka, and the database is to use the same CA to sign all of the certificates you will use when setting up TLS/SSL. Using the same root CA to sign the certificates requires you to be able to edit the configuration of Kafka, the database, and the scheduler. If you cannot use the same CA to sign all certificates, all truststores must contain the entire chain of CAs used to sign the certificates, all the way up to the root CA. Including the entire chain of trust ensures each system can verify each other&#39;s identities.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a name=&#34;Ensuring&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;verifying-identities&#34;&gt;Verifying identities&lt;/h2&gt;
&lt;p&gt;Your primary challenge when configuring TLS/SSL encryption between the database, the scheduler, and Kafka is making sure the scheduler, Kafka, and the database can all verify each other&#39;s identity. The most common problem people have encountered when setting up TLS/SSL encryption is ensuring the remote system can verify the authenticity of a system&#39;s certificate. The best way to prevent this problem is to ensure that the all systems have their certificates signed by a CA that all of the systems explicitly trust.&lt;/p&gt;
&lt;p&gt;When a system attempts to start an encrypted connection with another system, it sends its certificate to the remote system. This certificate can be signed by one or more Certificate Authorities (CA) that help identify the system making the connection. These signatures form a &amp;quot;chain of trust.&amp;quot; A certificate is signed by a CA. That CA, in turn, could have been signed by another CA, and so forth. Often, the chain ends with a CA (referred to as the root CA) from a well-known commercial provider of certificates, such as Comodo SSL or DigiCert, that are trusted by default on many platforms such as operating systems and web browsers.&lt;/p&gt;
&lt;p&gt;If the remote system finds a CA in the chain that it trusts, it verifies the identity of the system making the connection, and the connection can continue. If the remote system cannot find the signature of a CA it trusts, it may block the connection, depending on its configuration. Systems can be configured to only allow connections from systems whose identity has been verified.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

Verifying the identity of another system making a TLE/SSL connection is often referred to as &amp;quot;authentication.&amp;quot; Do not confuse this use of authentication with other forms of authentication used with the database. For example, TLS/SSL&#39;s authentication of a client connection has nothing to do with database user authentication. Even if you successfully establish a TLS/SSL connection to the database using a client, the databse requires you to provide a user name and password before you can interact with it.

&lt;/div&gt;&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Kafka-Integration: Configuring your scheduler for TLS connections</title>
      <link>/en/kafka-integration/tlsssl-encryption-with-kafka/configuring-your-scheduler-tls-connections/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/kafka-integration/tlsssl-encryption-with-kafka/configuring-your-scheduler-tls-connections/</guid>
      <description>
        
        
        &lt;p&gt;The scheduler can use TLS for two different connections: the one it makes to OpenText™ Analytics Database, and the connection it creates when running COPY statements to retrieve data from Kafka. Because the scheduler is a Java application, you supply the TLS key and the certificate used to sign it in a keystore. You also supply a truststore that contains in the certificates that the scheduler should trust. Both the connection to the database and to Kafka can use the same keystore and truststore. You can also choose to use separate keystores and truststores for these two connections by setting different JDBC settings for the scheduler. See &lt;a href=&#34;../../../en/connecting-to/client-libraries/accessing/java/creating-and-configuring-connection/jdbc-connection-properties/#&#34;&gt;JDBC connection properties&lt;/a&gt; for a list of these settings.&lt;/p&gt;
&lt;p&gt;See &lt;a href=&#34;../../../en/kafka-integration/tlsssl-encryption-with-kafka/configure-kafka-tls/#kafkaschedulertls&#34;&gt;Kafka TLS-SSL Example Part 5: Configure the Scheduler&lt;/a&gt; for detailed steps on configuring your scheduler to use SSL.&lt;/p&gt;

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
&lt;p&gt;If you choose to use a file format other than the standard Java Keystore (JKS) format for your keystore or truststore files, you must use the correct file extension in the filename. For example, suppose you choose to use a keystore and truststore saved in PKCS#12 format. Then your keystore and trustore files must end with the &lt;code&gt;.pfx&lt;/code&gt; or &lt;code&gt;.p12&lt;/code&gt; extension.&lt;/p&gt;
&lt;p&gt;If the scheduler does not recognize the file&#39;s extension (or there is no extension in the file name), it assumes that the file is in JKS format. If the file is not in JKS format, you will see an error message when starting the scheduler, similar to &amp;quot;Failed to create an SSLSocketFactory when setting up TLS: keystore not found.&amp;quot;&lt;/p&gt;

&lt;/div&gt;

&lt;p&gt;Note that if the Kafka server&#39;s parameter &lt;code&gt;client.ssl.auth&lt;/code&gt; is set to &lt;code&gt;none&lt;/code&gt; or &lt;code&gt;requested&lt;/code&gt;, you do not need to create a keystore.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Kafka-Integration: Using TLS/SSL when directly loading data from Kafka</title>
      <link>/en/kafka-integration/tlsssl-encryption-with-kafka/using-tlsssl-when-directly-loading-data-from-kafka/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/kafka-integration/tlsssl-encryption-with-kafka/using-tlsssl-when-directly-loading-data-from-kafka/</guid>
      <description>
        
        
        &lt;p&gt;You can manually load data from Kafka using the &lt;a href=&#34;../../../en/sql-reference/statements/copy/#&#34;&gt;COPY&lt;/a&gt; statement and the &lt;a href=&#34;../../../en/kafka-integration/kafka-function-reference/kafkasource/#&#34;&gt;KafkaSource&lt;/a&gt; user-defined load function (see &lt;a href=&#34;../../../en/kafka-integration/consuming-data-from-kafka/manually-consume-data-from-kafka/#&#34;&gt;Manually consume data from Kafka&lt;/a&gt;). To have KafkaSource open a secure connection to Kafka, you must supply it with an SSL key and other information.&lt;/p&gt;
&lt;p&gt;When starting, the KafkaSource function checks if several user session variables are defined. These variables contain the SSL key, the certificate used to sign the key, and other information that the function needs to create the SSL connection. See &lt;a href=&#34;../../../en/sql-reference/config-parameters/kafka-user-defined-session-parameters/#&#34;&gt;Kafka user-defined session parameters&lt;/a&gt; for a list of these variables. If KafkaSource finds these variables are defined, it uses them to create an SSL connection to Kafka.&lt;/p&gt;
&lt;p&gt;See &lt;a href=&#34;../../../en/kafka-integration/tlsssl-encryption-with-kafka/configure-kafka-tls/#kafkaloadtls&#34;&gt;Kafka TLS/SSL Example Part 4: Loading Data Directly From Kafka&lt;/a&gt; for a step-by-step guide on configuring and using an SSL connection when directly copying data from Kafka.&lt;/p&gt;
&lt;p&gt;These variables are also used by the KafkaExport function to establish a secure connection to Kafka when exporting data.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Kafka-Integration: Configure Kafka for TLS/SSL</title>
      <link>/en/kafka-integration/tlsssl-encryption-with-kafka/configure-kafka-tls/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/kafka-integration/tlsssl-encryption-with-kafka/configure-kafka-tls/</guid>
      <description>
        
        
        &lt;p&gt;This page covers procedures for configuring TLS connections OpenText™ Analytics Database, Kafka, and the scheduler.&lt;/p&gt;
&lt;p&gt;Note that the following example configures TLS for a Kafka server where &lt;code&gt;ssl.client.auth=required&lt;/code&gt;, which requires the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;kafka_SSL_Certificate&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;kafka_SSL_PrivateKey_secret&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;kafka_SSL_PrivateKeyPassword_secret&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A keystore for the Scheduler&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If your configuration uses &lt;code&gt;ssl.client.auth=none&lt;/code&gt; or &lt;code&gt;ssl.client.auth=requested&lt;/code&gt;, these parameters and the scheduler keystore are optional.&lt;/p&gt;
&lt;h2 id=&#34;creating-certificates-for-opentexttrade-analytics-database-and-clients&#34;&gt;Creating certificates for OpenText™ Analytics Database and clients&lt;/h2&gt;
&lt;p&gt;The CA certificate in this example is self-signed. In a production environment, you should instead use a trusted CA.&lt;/p&gt;
&lt;p&gt;This example uses the same self-signed root CA to sign all of the certificates used by the scheduler, Kafka brokers, and the database. If you cannot use the same CA to sign the keys for all of these systems, make sure you include the entire chain of trust in your keystores.&lt;/p&gt;
&lt;p&gt;For more information, see &lt;a href=&#34;../../../en/security-and-authentication/tls-protocol/tls-overview/generating-tls-certificates-and-keys/#&#34;&gt;Generating TLS certificates and keys&lt;/a&gt;.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Generate a private key, &lt;code&gt;root.key&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ &lt;span class=&#34;code-input&#34;&gt;openssl genrsa -out root.key&lt;/span&gt;
Generating RSA private key, 2048 bit long modulus
..............................................................................
............................+++
...............+++
e is 65537 (0x10001)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Generate a self-signed CA certificate.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ &lt;span class=&#34;code-input&#34;&gt;openssl req -new -x509 -key root.key -out root.crt&lt;/span&gt;
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter &amp;#39;.&amp;#39;, the field will be left blank.
-----
Country Name (2 letter code) [AU]:&lt;span class=&#34;code-input&#34;&gt;US&lt;/span&gt;
State or Province Name (full name) [Some-State]:&lt;span class=&#34;code-input&#34;&gt;MA&lt;/span&gt;
Locality Name (eg, city) []:&lt;span class=&#34;code-input&#34;&gt;Cambridge&lt;/span&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:&lt;span class=&#34;code-input&#34;&gt;My Company&lt;/span&gt;
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:&lt;span class=&#34;code-input&#34;&gt;*.mycompany.com&lt;/span&gt;
Email Address []:&lt;span class=&#34;code-input&#34;&gt;myemail@mycompany.com&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Restrict to the owner read/write permissions for &lt;code&gt;root.key&lt;/code&gt; and &lt;code&gt;root.crt&lt;/code&gt;. Grant read permissions to other groups for &lt;code&gt;root.crt&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
$ &lt;span class=&#34;code-input&#34;&gt;ls&lt;/span&gt;
root.crt  root.key
$ &lt;span class=&#34;code-input&#34;&gt;chmod 600 root.key&lt;/span&gt;
$ &lt;span class=&#34;code-input&#34;&gt;chmod 644 root.crt&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Generate the server private key, &lt;em&gt;&lt;code&gt;server.key&lt;/code&gt;&lt;/em&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ openssl genrsa -out server.key
Generating RSA private key, 2048 bit long modulus
....................................................................+++
......................................+++
e is 65537 (0x10001)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a certificate signing request (CSR) for your CA. Be sure to set the &amp;quot;Common Name&amp;quot; field to a wildcard (asterisk) so the certificate is accepted for all database nodes in the cluster:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ &lt;span class=&#34;code-input&#34;&gt;openssl req -new -key server.key -out server_reqout.txt&lt;/span&gt;
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter &amp;#39;.&amp;#39;, the field will be left blank.
-----
Country Name (2 letter code) [AU]:&lt;span class=&#34;code-input&#34;&gt;US&lt;/span&gt;
State or Province Name (full name) [Some-State]:&lt;span class=&#34;code-input&#34;&gt;MA&lt;/span&gt;
Locality Name (eg, city) []:&lt;span class=&#34;code-input&#34;&gt;Cambridge&lt;/span&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:&lt;span class=&#34;code-input&#34;&gt;My Company&lt;/span&gt;
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:&lt;span class=&#34;code-input&#34;&gt;*.mycompany.com&lt;/span&gt;
Email Address []:&lt;span class=&#34;code-input&#34;&gt;myemail@mycompany.com&lt;/span&gt;

Please enter the following &amp;#39;extra&amp;#39; attributes
to be sent with your certificate request
A challenge password []: &lt;span class=&#34;code-variable&#34;&gt;server_key_password&lt;/span&gt;
An optional company name []:
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Sign the server certificate with your CA. This creates the server certificate &lt;code&gt;server.crt&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ &lt;span class=&#34;code-input&#34;&gt;openssl x509 -req -in server_reqout.txt -days 3650 -sha1 -CAcreateserial -CA root.crt \
    -CAkey root.key -out server.crt&lt;/span&gt;
    Signature ok
    subject=/C=US/ST=MA/L=Cambridge/O=My Company/CN=*.mycompany.com/emailAddress=myemail@mycompany.com
    Getting CA Private Key
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Set the appropriate permissions for the key and certificate.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ &lt;span class=&#34;code-input&#34;&gt;chmod 600 server.key&lt;/span&gt;
$ &lt;span class=&#34;code-input&#34;&gt;chmod 644 server.crt&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;create-a-client-key-and-certificate-mutual-mode-only&#34;&gt;Create a client key and certificate (mutual mode only)&lt;/h3&gt;
&lt;p&gt;In &lt;strong&gt;Mutual Mode&lt;/strong&gt;, clients and servers verify each other&#39;s certificates before establishing a connection. The following procedure creates a client key and certificate to present to the database. The certificate must be signed by a CA that the database trusts.&lt;/p&gt;
&lt;p&gt;The steps for this are identical to those above for creating a server key and certificate for the database.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ &lt;span class=&#34;code-input&#34;&gt;openssl genrsa -out client.key&lt;/span&gt;
Generating RSA private key, 2048 bit long modulus
................................................................+++
..............................+++
e is 65537 (0x10001)

$ &lt;span class=&#34;code-input&#34;&gt;openssl req -new -key client.key -out client_reqout.txt&lt;/span&gt;
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter &amp;#39;.&amp;#39;, the field will be left blank.
-----
Country Name (2 letter code) [AU]:&lt;span class=&#34;code-input&#34;&gt;US&lt;/span&gt;
State or Province Name (full name) [Some-State]:&lt;span class=&#34;code-input&#34;&gt;MA&lt;/span&gt;
Locality Name (eg, city) []:&lt;span class=&#34;code-input&#34;&gt;Cambridge&lt;/span&gt;
Organization Name (eg, company) [Internet Widgits Pty Ltd]:&lt;span class=&#34;code-input&#34;&gt;My Company&lt;/span&gt;
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:&lt;span class=&#34;code-input&#34;&gt;*.mycompany.com&lt;/span&gt;
Email Address []:&lt;span class=&#34;code-input&#34;&gt;myemail@mycompany.com&lt;/span&gt;

Please enter the following &amp;#39;extra&amp;#39; attributes
to be sent with your certificate request
A challenge password []: &lt;span class=&#34;code-variable&#34;&gt;server_key_password&lt;/span&gt;
An optional company name []:

$ &lt;span class=&#34;code-input&#34;&gt;openssl x509 -req -in client_reqout.txt -days 3650 -sha1 -CAcreateserial -CA root.crt \
  -CAkey root.key -out client.crt&lt;/span&gt;
Signature ok
subject=/C=US/ST=MA/L=Cambridge/O=My Company/CN=*.mycompany.com/emailAddress=myemail@mycompany.com
Getting CA Private Key

$ &lt;span class=&#34;code-input&#34;&gt;chmod 600 client.key&lt;/span&gt;
$ &lt;span class=&#34;code-input&#34;&gt;chmod 644 client.crt&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;set-up-mutual-mode-client-server-tls&#34;&gt;Set up mutual mode client-server TLS&lt;/h2&gt;
&lt;h3 id=&#34;configure-opentexttrade-analytics-database-for-mutual-mode&#34;&gt;Configure OpenText™ Analytics Database for mutual mode&lt;/h3&gt;
&lt;p&gt;The following keys and certificates must be imported and then distributed to the nodes on your database cluster with TLS Configuration for &lt;strong&gt;Mutual Mode&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;root.key&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;root.crt&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;server.key&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;server.crt&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can view existing keys and certificates by querying &lt;a href=&#34;../../../en/sql-reference/system-tables/v-catalog-schema/cryptographic-keys/#&#34;&gt;CRYPTOGRAPHIC_KEYS&lt;/a&gt; and &lt;a href=&#34;../../../en/sql-reference/system-tables/v-catalog-schema/certificates/#&#34;&gt;CERTIFICATES&lt;/a&gt;.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Import the server and root keys and certificates into the database with &lt;a href=&#34;../../../en/sql-reference/statements/create-statements/create-key/#&#34;&gt;CREATE KEY&lt;/a&gt; and &lt;a href=&#34;../../../en/sql-reference/statements/create-statements/create-certificate/#&#34;&gt;CREATE CERTIFICATE&lt;/a&gt;. For more information, see &lt;a href=&#34;../../../en/security-and-authentication/tls-protocol/tls-overview/generating-tls-certificates-and-keys/#&#34;&gt;Generating TLS certificates and keys&lt;/a&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE KEY imported_key TYPE &amp;#39;RSA&amp;#39; AS &amp;#39;-----BEGIN PRIVATE KEY-----...-----END PRIVATE KEY-----&amp;#39;;
=&amp;gt; CREATE CA CERTIFICATE imported_ca AS &amp;#39;-----BEGIN CERTIFICATE-----...-----END CERTIFICATE-----&amp;#39;;
=&amp;gt; CREATE CERTIFICATE imported_cert AS &amp;#39;-----BEGIN CERTIFICATE-----...-----END CERTIFICATE-----&amp;#39;;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In this example, &lt;a href=&#34;../../../en/connecting-to/using-vsql/meta-commands/set/&#34;&gt;\set&lt;/a&gt; is used to retrieve the contents of &lt;code&gt;root.key&lt;/code&gt;, &lt;code&gt;root.crt&lt;/code&gt;, &lt;code&gt;server.key&lt;/code&gt;, and &lt;code&gt;server.crt&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; \set ca_cert &amp;#39;&amp;#39;&amp;#39;&amp;#39;`cat root.crt`&amp;#39;&amp;#39;&amp;#39;&amp;#39;
=&amp;gt; \set serv_key &amp;#39;&amp;#39;&amp;#39;&amp;#39;`cat server.key`&amp;#39;&amp;#39;&amp;#39;&amp;#39;
=&amp;gt; \set serv_cert &amp;#39;&amp;#39;&amp;#39;&amp;#39;`cat server.crt`&amp;#39;&amp;#39;&amp;#39;&amp;#39;

=&amp;gt; CREATE CA CERTIFICATE root_ca AS :ca_cert;
CREATE CERTIFICATE
=&amp;gt; CREATE KEY server_key TYPE &amp;#39;RSA&amp;#39; AS :serv_key;
CREATE KEY
=&amp;gt; CREATE CERTIFICATE server_cert AS :serv_cert;
CREATE CERTIFICATE
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Follow the steps for &lt;strong&gt;Mutual Mode&lt;/strong&gt; in &lt;a href=&#34;../../../en/security-and-authentication/tls-protocol/tls-overview/configuring-client-server-tls/#&#34;&gt;Configuring client-server TLS&lt;/a&gt; to set the proper TLSMODE and TLS Configuration parameters.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;configure-a-client-for-mutual-mode&#34;&gt;Configure a client for mutual mode&lt;/h3&gt;
&lt;p&gt;Clients must have their private key, certificate, and CA certificate. The certificate will be presented to the database when establishing a connection, and the CA certificate will be used to verify the server certificate from the database.&lt;/p&gt;
&lt;p&gt;This example configures the &lt;code&gt;vsql&lt;/code&gt; client for mutual mode.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a &lt;code&gt;.vsql&lt;/code&gt; directory in the user&#39;s home directory.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ mkdir ~/.vsql
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Copy &lt;code&gt;client.key&lt;/code&gt;, &lt;code&gt;client.crt&lt;/code&gt;, and &lt;code&gt;root.crt&lt;/code&gt; to the &lt;code&gt;vsql&lt;/code&gt; directory.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ cp client.key client.crt root.crt ~/.vsql
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Log into the database with &lt;code&gt;vsql&lt;/code&gt; and query the &lt;a href=&#34;../../../en/sql-reference/system-tables/v-monitor-schema/sessions/#&#34;&gt;SESSIONS&lt;/a&gt; system table to verify that the connection is using mutual mode:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ vsql
Password: &lt;span class=&#34;code-variable&#34;&gt;user-password&lt;/span&gt;
Welcome to vsql, the Vertica Analytic Database interactive terminal.

Type:  \h or \? for help with vsql commands
       \g or terminate with semicolon to execute query
       \q to quit

SSL connection (cipher: DHE-RSA-AES256-GCM-SHA384, bits: 256, protocol: TLSv1.2)

=&amp;gt; select user_name,ssl_state from sessions;
 user_name | ssl_state
-----------+-----------
 dbadmin   | Mutual
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;configure-kafka-for-tls&#34;&gt;Configure Kafka for TLS&lt;/h2&gt;
&lt;h3 id=&#34;configure-the-kafka-brokers&#34;&gt;Configure the Kafka brokers&lt;/h3&gt;
&lt;p&gt;This procedure configures Kafka to use TLS with client connections. You can also configure Kafka to use TLS to communicate between brokers. However, inter-broker TLS has no impact on establishing an encrypted connection between the database and Kafka.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a truststore file for all of your Kafka brokers, importing your CA certificate. This example uses the self-signed &lt;code&gt;root.crt&lt;/code&gt; created above.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; $ &lt;span class=&#34;code-input&#34;&gt;keytool -keystore kafka.truststore.jks -alias CARoot -import \
               -file root.crt&lt;/span&gt;
Enter keystore password: &lt;span class=&#34;code-variable&#34;&gt;some_password&lt;/span&gt;
Re-enter new password: &lt;span class=&#34;code-variable&#34;&gt;some_password&lt;/span&gt;
Owner: EMAILADDRESS=myemail@mycompany.com, CN=*.mycompany.com, O=MyCompany, L=Cambridge, ST=MA, C=US
Issuer: EMAILADDRESS=myemail@mycompany.com, CN=*.mycompany.com, O=MyCompany, L=Cambridge, ST=MA, C=US
Serial number: c3f02e87707d01aa
Valid from: Fri Mar 22 13:37:37 EDT 2019 until: Sun Apr 21 13:37:37 EDT 2019
Certificate fingerprints:
         MD5:  73:B1:87:87:7B:FE:F1:6E:94:55:FD:AF:5D:D0:C3:0C
         SHA1: C0:69:1C:93:54:21:87:C7:03:93:FE:39:45:66:DE:22:18:7E:CD:94
         SHA256: 23:03:BB:B7:10:12:50:D9:C5:D0:B7:58:97:41:1E:0F:25:A0:DB:
                 D0:1E:7D:F9:6E:60:8F:79:A6:1C:3F:DD:D5
Signature algorithm name: SHA256withRSA
Subject Public Key Algorithm: 2048-bit RSA key
Version: 3

Extensions:

#1: ObjectId: 2.5.29.35 Criticality=false
AuthorityKeyIdentifier [
KeyIdentifier [
0000: 50 69 11 64 45 E9 CC C5   09 EE 26 B5 3E 71 39 7C  Pi.dE.....&amp;amp;.&amp;gt;q9.
0010: E5 3D 78 16                                        .=x.
]
]

#2: ObjectId: 2.5.29.19 Criticality=false
BasicConstraints:[
  CA:true
  PathLen:2147483647
]

#3: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 50 69 11 64 45 E9 CC C5   09 EE 26 B5 3E 71 39 7C  Pi.dE.....&amp;amp;.&amp;gt;q9.
0010: E5 3D 78 16                                        .=x.
]
]

Trust this certificate? [no]:  &lt;span class=&#34;code-input&#34;&gt;yes&lt;/span&gt;
Certificate was added to keystore
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a keystore file for the Kafka broker named &lt;code&gt;kafka01&lt;/code&gt;. Each broker&#39;s keystore should be unique.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;keytool&lt;/code&gt; command adds the a Subject Alternative Name (SAN) used as a fallback when establishing a TLS connection. Use your Kafka&#39; broker&#39;s fully-qualified domain name (FQDN) as the value for the SAN and &amp;quot;What is your first and last name?&amp;quot; prompt.&lt;/p&gt;
&lt;p&gt;In this example, the FQDN is &lt;code&gt;kafka01.example.com&lt;/code&gt;. The alias for &lt;code&gt;keytool&lt;/code&gt; is set to &lt;code&gt;localhost&lt;/code&gt;, so local connections to the broker use TLS.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ &lt;span class=&#34;code-input&#34;&gt;keytool -keystore kafka01.keystore.jks -alias localhost -validity 365 -genkey -keyalg RSA \
      -ext SAN=DNS:kafka01.mycompany.com&lt;/span&gt;
Enter keystore password: &lt;span class=&#34;code-variable&#34;&gt;some_password&lt;/span&gt;
Re-enter new password: &lt;span class=&#34;code-variable&#34;&gt;some_password&lt;/span&gt;
What is your first and last name?
  [Unknown]:  &lt;span class=&#34;code-input&#34;&gt;kafka01.mycompany.com&lt;/span&gt;
What is the name of your organizational unit?
  [Unknown]:
What is the name of your organization?
  [Unknown]: &lt;span class=&#34;code-input&#34;&gt;MyCompany&lt;/span&gt;
What is the name of your City or Locality?
  [Unknown]:  &lt;span class=&#34;code-input&#34;&gt;Cambridge&lt;/span&gt;
What is the name of your State or Province?
  [Unknown]:  &lt;span class=&#34;code-input&#34;&gt;MA&lt;/span&gt;
What is the two-letter country code for this unit?
  [Unknown]:  &lt;span class=&#34;code-input&#34;&gt;US&lt;/span&gt;
Is CN=Database Admin, OU=MyCompany, O=Unknown, L=Cambridge, ST=MA, C=US correct?
  [no]:  &lt;span class=&#34;code-input&#34;&gt;yes&lt;/span&gt;

Enter key password for &amp;lt;localhost&amp;gt;
        (RETURN if same as keystore password):
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Export the Kafka broker&#39;s certificate. In this example, the certificate is exported as &lt;code&gt;kafka01.unsigned.crt&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ &lt;span class=&#34;code-input&#34;&gt;keytool -keystore kafka01.keystore.jks -alias localhost \
                -certreq -file kafka01.unsigned.crt&lt;/span&gt;
 Enter keystore password: &lt;span class=&#34;code-variable&#34;&gt;some_password&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Sign the broker&#39;s certificate with the CA certificate.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ &lt;span class=&#34;code-input&#34;&gt;openssl x509 -req -CA root.crt -CAkey root.key -in kafka01.unsigned.crt \
             -out kafka01.signed.crt -days 365 -CAcreateserial&lt;/span&gt;
Signature ok
subject=/C=US/ST=MA/L=Cambridge/O=Unknown/OU=MyCompany/CN=Database Admin
Getting CA Private Key
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Import the CA certificate into the broker&#39;s keystore.&lt;/p&gt;

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

If you use different CAs to sign the certificates in your environment, you must add the entire chain of CAs you used to sign your certificate to the keystore, all the way up to the root CA. Including the entire chain of trust helps other systems verify the identity of your Kafka broker.

&lt;/div&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ &lt;span class=&#34;code-input&#34;&gt;keytool -keystore kafka01.keystore.jks -alias CARoot -import -file root.crt&lt;/span&gt;
Enter keystore password: &lt;span class=&#34;code-variable&#34;&gt;some_password&lt;/span&gt;
Owner: EMAILADDRESS=myemail@mycompany.com, CN=*.mycompany.com, O=MyCompany, L=Cambridge, ST=MA, C=US
Issuer: EMAILADDRESS=myemail@mycompany.com, CN=*.mycompany.com, O=MyCompany, L=Cambridge, ST=MA, C=US
Serial number: c3f02e87707d01aa
Valid from: Fri Mar 22 13:37:37 EDT 2019 until: Sun Apr 21 13:37:37 EDT 2019
Certificate fingerprints:
         MD5:  73:B1:87:87:7B:FE:F1:6E:94:55:FD:AF:5D:D0:C3:0C
         SHA1: C0:69:1C:93:54:21:87:C7:03:93:FE:39:45:66:DE:22:18:7E:CD:94
         SHA256: 23:03:BB:B7:10:12:50:D9:C5:D0:B7:58:97:41:1E:0F:25:A0:DB:D0:1E:7D:F9:6E:60:8F:79:A6:1C:3F:DD:D5
Signature algorithm name: SHA256withRSA
Subject Public Key Algorithm: 2048-bit RSA key
Version: 3

Extensions:

#1: ObjectId: 2.5.29.35 Criticality=false
AuthorityKeyIdentifier [
KeyIdentifier [
0000: 50 69 11 64 45 E9 CC C5   09 EE 26 B5 3E 71 39 7C  Pi.dE.....&amp;amp;.&amp;gt;q9.
0010: E5 3D 78 16                                        .=x.
]
]

#2: ObjectId: 2.5.29.19 Criticality=false
BasicConstraints:[
  CA:true
  PathLen:2147483647
]

#3: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 50 69 11 64 45 E9 CC C5   09 EE 26 B5 3E 71 39 7C  Pi.dE.....&amp;amp;.&amp;gt;q9.
0010: E5 3D 78 16                                        .=x.
]
]

Trust this certificate? [no]:  &lt;span class=&#34;code-input&#34;&gt;yes&lt;/span&gt;
Certificate was added to keystore
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Import the signed Kafka broker certificate into the keystore.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ &lt;span class=&#34;code-input&#34;&gt;keytool -keystore kafka01.keystore.jks -alias localhost \
                -import -file kafka01.signed.crt&lt;/span&gt;
Enter keystore password: &lt;span class=&#34;code-variable&#34;&gt;some_password&lt;/span&gt;
Owner: CN=Database Admin, OU=MyCompany, O=Unknown, L=Cambridge, ST=MA, C=US
Issuer: EMAILADDRESS=myemail@mycompany.com, CN=*.mycompany.com, O=MyCompany, L=Cambridge, ST=MA, C=US
Serial number: b4bba9a1828ecaaf
Valid from: Tue Mar 26 12:26:34 EDT 2019 until: Wed Mar 25 12:26:34 EDT 2020
Certificate fingerprints:
            MD5:  17:EA:3E:15:B4:15:E9:93:67:EE:59:C0:4F:D1:4C:01
            SHA1: D5:35:B7:F7:44:7C:D6:B4:56:6F:38:2D:CD:3A:16:44:19:C1:06:B7
            SHA256: 25:8C:46:03:60:A7:4C:10:A8:12:8E:EA:4A:FA:42:1D:A8:C5:FB:65:81:74:CB:46:FD:B1:33:64:F2:A3:46:B0
Signature algorithm name: SHA256withRSA
Subject Public Key Algorithm: 2048-bit RSA key
Version: 1
Trust this certificate? [no]:  &lt;span class=&#34;code-input&#34;&gt;yes&lt;/span&gt;
Certificate was added to keystore
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you are not logged into the Kafka broker for which you prepared the keystore, copy the truststore and keystore to it using scp. If you have already decided where to store the keystore and truststore files in the broker&#39;s filesystem, you can directly copy them to their final destination. This example just copies them to the root user&#39;s home directory temporarily. The next step moves them into their final location.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ &lt;span class=&#34;code-input&#34;&gt;scp kafka.truststore.jks kafka01.keystore.jks root@kafka01.mycompany.com:&lt;/span&gt;
root@kafka01.mycompany.com&amp;#39;s password: &lt;span class=&#34;code-variable&#34;&gt;root_password&lt;/span&gt;
kafka.truststore.jks                              100% 1048     1.0KB/s   00:00
kafka01.keystore.jks                              100% 3277     3.2KB/s   00:00
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Repeat steps 2 through 7 for the remaining Kafka brokers.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;allow-kafka-to-read-the-keystore-and-truststore&#34;&gt;Allow Kafka to read the keystore and truststore&lt;/h3&gt;
&lt;p&gt;If you did not copy the truststore and keystore to directory where Kafka can read them in the previous step, you must copy them to a final location on the broker. You must also allow the user account you use to run Kafka to read these files. The easiest way to ensure the user&#39;s access is to give this user ownership of these files.&lt;/p&gt;
&lt;p&gt;In this example, Kafka is run by a Linux user &lt;code&gt;kafka&lt;/code&gt;. If you use another user to run Kafka, be sure to set the permissions on the truststore and keystore files appropriately.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Log into the Kafka broker as root.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Copy the truststore and keystore to a directory where Kafka can access them. There is no set location for these files: you can choose a directory under /etc, or some other location where configuration files are usually stored. This example copies them from root&#39;s home directory to Kafka&#39;s configuration directory named /opt/kafka/config/. In your own system, this configuration directory may be in a different location depending on how you installed Kafka.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Copy the truststore and keystore to a directory where Kafka can access them. There is no set location for these files: you can choose a directory under &lt;code&gt;/etc&lt;/code&gt;, or some other location where configuration files are usually stored. This example copies them from root&#39;s home directory to Kafka&#39;s configuration directory named &lt;code&gt;/opt/kafka/config/&lt;/code&gt;. In your own system, this configuration directory may be in a different location depending on how you installed Kafka.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;~# &lt;span class=&#34;code-input&#34;&gt;cd /opt/kafka/config/&lt;/span&gt;
/opt/kafka/config# &lt;span class=&#34;code-input&#34;&gt;cp /root/kafka01.keystore.jks /root/kafka.truststore.jks .&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you aren&#39;t logged in as a user account that runs Kafka, change the ownership of the truststore and keystore files. This example changes the ownership from root (which is the user currently logged in) to the kafka user:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;/opt/kafka/config# &lt;span class=&#34;code-input&#34;&gt;ls -l&lt;/span&gt;
total 80
...
-rw-r--r-- 1 kafka nogroup 1221 Feb 21  2018 consumer.properties
-rw------- 1 root  root    3277 Mar 27 08:03 kafka01.keystore.jks
-rw-r--r-- 1 root  root    1048 Mar 27 08:03 kafka.truststore.jks
-rw-r--r-- 1 kafka nogroup 4727 Feb 21  2018 log4j.properties
...
/opt/kafka/config# &lt;span class=&#34;code-input&#34;&gt;chown kafka kafka01.keystore.jks kafka.truststore.jks&lt;/span&gt;
/opt/kafka/config# &lt;span class=&#34;code-input&#34;&gt;ls -l&lt;/span&gt;
total 80
...
-rw-r--r-- 1 kafka nogroup 1221 Feb 21  2018 consumer.properties
-rw------- 1 kafka root    3277 Mar 27 08:03 kafka01.keystore.jks
-rw-r--r-- 1 kafka root    1048 Mar 27 08:03 kafka.truststore.jks
-rw-r--r-- 1 kafka nogroup 4727 Feb 21  2018 log4j.properties
...
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Repeat steps 1 through 3 for the remaining Kafka brokers.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;configure-kafka-to-use-tls&#34;&gt;Configure Kafka to use TLS&lt;/h3&gt;
&lt;p&gt;With the truststore and keystore in place, your next step is to edit the Kafka&#39;s &lt;code&gt;server.properties&lt;/code&gt; configuration file to tell Kafka to use TLS/SSL encryption. This file is usually stored in the Kafka config directory. The location of this directory depends on how you installed Kafka. In this example, the file is located in &lt;code&gt;/opt/kafka/config&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;When editing the files, be sure you do not change their ownership. The best way to ensure Linux does not change the file&#39;s ownership is to use su to become the user account that runs Kafka, assuming you are not already logged in as that user:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ /opt/kafka/config# &lt;span class=&#34;code-input&#34;&gt;su -s /bin/bash kafka&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

The previous command lets you start a shell as the kafka system user even if that user cannot log in.

&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;server.properties&lt;/code&gt; file contains Kafka broker settings in a &lt;em&gt;&lt;code&gt;property&lt;/code&gt;&lt;/em&gt;&lt;code&gt;=&lt;/code&gt;&lt;em&gt;&lt;code&gt;value&lt;/code&gt;&lt;/em&gt; format. To configure the Kafka broker to use SSL, alter or add the following property settings:&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;listeners&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Host names and ports on which the Kafka broker listens. If you are not using SSL for connections between brokers, you must supply both a PLANTEXT and SSL option. For example:
&lt;p&gt;&lt;code&gt;listeners=PLAINTEXT://&lt;/code&gt;&lt;em&gt;&lt;code&gt;hostname&lt;/code&gt;&lt;/em&gt;&lt;code&gt;:9092,SSL://&lt;/code&gt;&lt;em&gt;&lt;code&gt;hostname&lt;/code&gt;&lt;/em&gt;&lt;code&gt;:9093&lt;/code&gt;&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;ssl.keystore.location&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Absolute path to the keystore file.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;ssl.keystore.password&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Password for the keystore file.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;ssl.key.password&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Password for the Kafka broker&#39;s key in the keystore. You can make this password different than the keystore password if you choose.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;ssl.truststore.location&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Location of the truststore file.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;ssl.truststore.password&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Password to access the truststore.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;ssl.enabled.protocols&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;TLS/SSL protocols that Kafka allows clients to use.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;ssl.client.auth&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Specifies whether SSL authentication is required or optional. The most secure setting for this setting is required to verify the client&#39;s identity.&lt;/dd&gt;
&lt;/dl&gt;

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
These settings vary depending on your version of Kafka. Always consult the &lt;a href=&#34;http://kafka.apache.org/documentation/&#34;&gt;Apache Kafka documentation&lt;/a&gt; for your version of Kafka before making changes to &lt;code&gt;server.properties&lt;/code&gt;. In particular, be aware that Kafka version 2.0 and later enables host name verification for clients and inter-broker communications by default.
&lt;/div&gt;
&lt;p&gt;This example configures Kafka to verify client identities via SSL authentication. It does not use SSL to communicate with other brokers, so the &lt;code&gt;server.properties&lt;/code&gt; file defines both SSL and PLAINTEXT listener ports. It does not supply a host name for listener ports which tells Kafka to listen on the default network interface.&lt;/p&gt;
&lt;p&gt;The lines added to the kafka01 broker&#39;s copy of &lt;code&gt;server.properties&lt;/code&gt; for this configuration are:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;listeners=PLAINTEXT://:9092,SSL://:9093
ssl.keystore.location=/opt/kafka/config/kafka01.keystore.jks
ssl.keystore.password=vertica
ssl.key.password=vertica
ssl.truststore.location=/opt/kafka/config/kafka.truststore.jks
ssl.truststore.password=vertica
ssl.enabled.protocols=TLSv1.2,TLSv1.1,TLSv1
ssl.client.auth=required
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You must make these changes to the &lt;code&gt;server.properties&lt;/code&gt; file on all of your brokers.&lt;/p&gt;
&lt;p&gt;After making your changes to your broker&#39;s &lt;code&gt;server.properties&lt;/code&gt; files, restart Kafka. How you restart Kafka depends on your installation:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;If Kafka is running as part of a Hadoop cluster, you can usually restart it from within whatever interface you use to control Hadoop (such as Ambari).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you installed Kafka directly, you can restart it either by directly running the &lt;code&gt;kafka-server-stop.sh&lt;/code&gt; and &lt;code&gt;kafka-server-start.sh&lt;/code&gt; scripts or via the Linux system&#39;s service control commands (such as &lt;code&gt;systemctl&lt;/code&gt;). You must run this command on each broker.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;test-the-configuration&#34;&gt;Test the configuration&lt;/h3&gt;
&lt;p&gt;If you have not configured client authentication, you can quickly test whether Kafka can access its keystore by running the command:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ openssl s_client -debug -connect broker_host_name:9093 -tls1
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If Kafka is able to access its keystore, this command will output a dump of the broker&#39;s certificate (exit with CTRL+C):&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; # openssl s_client -debug -connect kafka01.mycompany.com:9093 -tls1
CONNECTED(00000003)
write to 0xa4e4f0 [0xa58023] (197 bytes =&amp;gt; 197 (0xC5))
0000 - 16 03 01 00 c0 01 00 00-bc 03 01 76 85 ed f0 fe   ...........v....
0010 - 60 60 7e 78 9d d4 a8 f7-e6 aa 5c 80 b9 a7 37 61   ``~x......\...7a
0020 - 8e 04 ac 03 6d 52 86 f5-84 4b 5c 00 00 62 c0 14   ....mR...K\..b..
0030 - c0 0a 00 39 00 38 00 37-00 36 00 88 00 87 00 86   ...9.8.7.6......
0040 - 00 85 c0 0f c0 05 00 35-00 84 c0 13 c0 09 00 33   .......5.......3
0050 - 00 32 00 31 00 30 00 9a-00 99 00 98 00 97 00 45   .2.1.0.........E
0060 - 00 44 00 43 00 42 c0 0e-c0 04 00 2f 00 96 00 41   .D.C.B...../...A
0070 - c0 11 c0 07 c0 0c c0 02-00 05 00 04 c0 12 c0 08   ................
0080 - 00 16 00 13 00 10 00 0d-c0 0d c0 03 00 0a 00 ff   ................
0090 - 01 00 00 31 00 0b 00 04-03 00 01 02 00 0a 00 1c   ...1............
00a0 - 00 1a 00 17 00 19 00 1c-00 1b 00 18 00 1a 00 16   ................
00b0 - 00 0e 00 0d 00 0b 00 0c-00 09 00 0a 00 23 00 00   .............#..
00c0 - 00 0f 00 01 01                                    .....
read from 0xa4e4f0 [0xa53ad3] (5 bytes =&amp;gt; 5 (0x5))
0000 - 16 03 01 08 fc                                    .....
             . . .
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The above method is not conclusive, however; it only tells you if Kafka is able to find its keystore.&lt;/p&gt;
&lt;p&gt;The best test of whether Kafka is able to accept TLS connections is to configure the command-line Kafka producer and consumer. In order to configure these tools, you must first create a client keystore. These steps are identical to creating a broker keystore.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

This example assumes that Kafka has a topic named test that you can send test messages to.

&lt;/div&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create the client keystore:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;keytool -keystore client.keystore.jks -alias localhost -validity 365 -genkey -keyalg RSA -ext SAN=DNS:&lt;span class=&#34;code-variable&#34;&gt;fqdn_of_client_system&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Respond to the &amp;quot;What is your first and last name?&amp;quot; with the FQDN of the system you will use to run the producer and/or consumer. Answer the rest of the prompts with the details of your organization.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Export the client certificate so it can be signed:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;keytool -keystore client.keystore.jks -alias localhost -certreq -file client.unsigned.cert
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Sign the client certificate with the root CA:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;openssl x509 -req -CA root.crt -CAkey root.key -in client.unsigned.cert -out client.signed.cert \
        -days 365 -CAcreateserial
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add the root CA to keystore:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;keytool -keystore client.keystore.jks -alias CARoot -import -file root.crt
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add the signed client certificate to the keystore:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;keytool -keystore client.keystore.jks -alias localhost -import -file client.signed.cert
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Copy the keystore to a location where you will use it. For example, you could choose to copy it to the same directory where you copied the keystore for the Kafka broker. If you choose to copy it to some other location, or intend to use some other user to run the command-line clients, be sure to add a copy of the truststore file you created for the brokers. Clients can reuse this truststore file for authenticating the Kafka brokers because the same CA is used to sign all of the certificates. Also set the file&#39;s ownership and permissions accordingly.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Next, you must create a properties file (similar to the broker&#39;s &lt;code&gt;server.properties&lt;/code&gt; file) that configures the command-line clients to use TLS. For a client running on the Kafka broker named kafka01, your configuration file could would look like this:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;security.protocol=SSL
ssl.truststore.location=/opt/kafka/config/kafka.truststore.jks
ssl.truststore.password=&lt;span class=&#34;code-variable&#34;&gt;trustore_password&lt;/span&gt;
ssl.keystore.location=/opt/kafka/config/client.keystore.jks
ssl.keystore.password=&lt;span class=&#34;code-variable&#34;&gt;keystore_password&lt;/span&gt;
ssl.key.password=&lt;span class=&#34;code-variable&#34;&gt;key_password&lt;/span&gt;
ssl.enabled.protocols=TLSv1.2,TLSv1.1,TLSv1
ssl.client.auth=required
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This property file assumes the keystore file is located in the Kafka configuration directory.&lt;/p&gt;
&lt;p&gt;Finally, you can run the command line producer or consumer to ensure they can connect and process data. You supply these clients the properties file you just created. The following example assumes you stored the properties file in the Kafka configuration directory, and that Kafka is installed in &lt;code&gt;/opt/kafka&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;~# &lt;span class=&#34;code-input&#34;&gt;cd /opt/kafka&lt;/span&gt;


/opt/kafka# &lt;span class=&#34;code-input&#34;&gt;bin/kafka-console-producer.sh --broker-list kafka01.mycompany.com:9093  \
                                          --topic test --producer.config config/client.properties&lt;/span&gt;
&amp;gt;&lt;span class=&#34;code-input&#34;&gt;test&lt;/span&gt;
&amp;gt;&lt;span class=&#34;code-input&#34;&gt;test again&lt;/span&gt;
&amp;gt;&lt;span class=&#34;code-input&#34;&gt;More testing. These messages seem to be getting through!
^D&lt;/span&gt;
/opt/kafka# &lt;span class=&#34;code-input&#34;&gt;bin/kafka-console-consumer.sh --bootstrap-server kafaka01.mycompany.com:9093  --topic test \
                                          --consumer.config config/client.properties --from-beginning&lt;/span&gt;
test
test again
More testing. These messages seem to be getting through!
&lt;span class=&#34;code-input&#34;&gt;^C&lt;/span&gt;
Processed a total of 3 messages
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;loading-data-from-kafka&#34;&gt;Loading data from Kafka&lt;/h2&gt;
&lt;p&gt;After you configure Kafka to accept TLS connections, verify that you can directly load data from it into the database. You should perform this step even if you plan to create a scheduler to automatically stream data.&lt;/p&gt;
&lt;p&gt;You can choose to create a separate key and certificate for directly loading data from Kafka. This example re-uses the key and certificate created for the database server in part 2 of this example.&lt;/p&gt;
&lt;p&gt;You directly load data from Kafka by using the &lt;a href=&#34;../../../en/kafka-integration/kafka-function-reference/kafkasource/#&#34;&gt;KafkaSource&lt;/a&gt; data source function with the &lt;a href=&#34;../../../en/sql-reference/statements/copy/#&#34;&gt;COPY&lt;/a&gt; statement (see &lt;a href=&#34;../../../en/kafka-integration/consuming-data-from-kafka/manually-consume-data-from-kafka/#&#34;&gt;Manually consume data from Kafka&lt;/a&gt;). The KafkaSource function creates the connection to Kafka, so it needs a key, certificate, and related passwords to create an encrypted connection. You pass this information via session parameters. See &lt;a href=&#34;../../../en/sql-reference/config-parameters/kafka-user-defined-session-parameters/#&#34;&gt;Kafka user-defined session parameters&lt;/a&gt; for a list of these parameters.&lt;/p&gt;
&lt;p&gt;The easiest way to get the key and certificate into the parameters is by first reading them into &lt;a href=&#34;../../../en/connecting-to/using-vsql/variables/&#34;&gt;vsql variables&lt;/a&gt;. You get their contents by using back quotes to read the file contents via the Linux shell. Then you set the session parameters from the variables. Before setting the session parameters, increase the MaxSessionUDParameterSize session parameter to add enough storage space in the session variables for the key and the certificates. They can be larger than the default size limit for session variables (1000 bytes).&lt;/p&gt;
&lt;p&gt;The following example reads the server key and certificate and the root CA from the a directory named &lt;code&gt;/home/dbadmin/SSL&lt;/code&gt;. Because the server&#39;s key password is not saved in a file, the example sets it in a Linux environment variable named KVERTICA_PASS before running vsql. The example sets MaxSessionUDParameterSize to 100000 before setting the session variables. Finally, it enables TLS for the Kafka connection and streams data from the topic named test.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ &lt;span class=&#34;code-input&#34;&gt;export KVERTICA_PASS=&lt;/span&gt;&lt;span class=&#34;code-variable&#34;&gt;server_key_password&lt;/span&gt;
$ &lt;span class=&#34;code-input&#34;&gt;vsql&lt;/span&gt;
Password:
Welcome to vsql, the Vertica Analytic Database interactive terminal.

Type:  \h or \? for help with vsql commands
       \g or terminate with semicolon to execute query
       \q to quit

SSL connection (cipher: DHE-RSA-AES256-GCM-SHA384, bits: 256, protocol: TLSv1.2)

=&amp;gt; \set cert &amp;#39;\&amp;#39;&amp;#39;`cat /home/dbadmin/SSL/server.crt`&amp;#39;\&amp;#39;&amp;#39;
=&amp;gt; \set pkey &amp;#39;\&amp;#39;&amp;#39;`cat /home/dbadmin/SSL/server.key`&amp;#39;\&amp;#39;&amp;#39;
=&amp;gt; \set ca &amp;#39;\&amp;#39;&amp;#39;`cat /home/dbadmin/SSL/root.crt`&amp;#39;\&amp;#39;&amp;#39;
=&amp;gt; \set pass &amp;#39;\&amp;#39;&amp;#39;`echo $KVERTICA_PASS`&amp;#39;\&amp;#39;&amp;#39;
=&amp;gt; alter session set MaxSessionUDParameterSize=100000;
ALTER SESSION
=&amp;gt; ALTER SESSION SET UDPARAMETER kafka_SSL_Certificate=:cert;
ALTER SESSION
=&amp;gt; ALTER SESSION SET UDPARAMETER kafka_SSL_PrivateKey_secret=:pkey;
ALTER SESSION
=&amp;gt; ALTER SESSION SET UDPARAMETER kafka_SSL_PrivateKeyPassword_secret=:pass;
ALTER SESSION
=&amp;gt; ALTER SESSION SET UDPARAMETER kafka_SSL_CA=:ca;
ALTER SESSION
=&amp;gt; ALTER SESSION SET UDPARAMETER kafka_Enable_SSL=1;
ALTER SESSION
=&amp;gt; CREATE TABLE t (a VARCHAR);
CREATE TABLE
=&amp;gt; COPY t SOURCE KafkaSource(brokers=&amp;#39;kafka01.mycompany.com:9093&amp;#39;,
                             stream=&amp;#39;test|0|-2&amp;#39;, stop_on_eof=true,
                             duration=interval &amp;#39;5 seconds&amp;#39;)
          PARSER KafkaParser();
 Rows Loaded
-------------
           3
(1 row)

=&amp;gt; SELECT * FROM t;
                            a
---------------------------------------------------------
 test again
 More testing. These messages seem to be getting through!
 test

(3 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;configure-the-scheduler&#34;&gt;Configure the scheduler&lt;/h2&gt;
&lt;p&gt;The final piece of the configuration is to set up the scheduler to use SSL when communicating with Kafka (and optionally with the database). When the scheduler runs a COPY command to get data from Kafka, it uses its own key and certificate to authenticate with Kafka. If you choose to have the scheduler use TLS/SSL to connect to the database, it can reuse the same keystore and truststore to make this connection.&lt;/p&gt;
&lt;h3 id=&#34;create-a-truststore-and-keystore-for-the-scheduler&#34;&gt;Create a truststore and keystore for the scheduler&lt;/h3&gt;
&lt;p&gt;Because the scheduler is a separate component, it must have its own key and certificate. The scheduler runs in Java and uses the JDBC interface to connect to the database. Therefore, you must create a keystore (when &lt;code&gt;ssl.client.auth=required&lt;/code&gt; ) and truststore for it to use when making a TLS-encrypted connection to the database.&lt;/p&gt;
&lt;p&gt;Keep in mind that creating a keystore is optional if your Kafka server sets &lt;code&gt;ssl.client.auth&lt;/code&gt; to &lt;code&gt;none&lt;/code&gt; or &lt;code&gt;requested&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This process is similar to creating the truststores and keystores for Kafka brokers. The main difference is using the the &lt;code&gt;-dname&lt;/code&gt; option for &lt;code&gt;keytool&lt;/code&gt; to set the Common Name (CN) for the key to a domain wildcard. Using this setting allows the key and certificate to match any host in the network. This option is especially useful if you run multiple schedulers on different servers to provide redundancy. The schedulers can use the same key and certificate, no matter which server they are running on in your domain.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a truststore file for the scheduler. Add the CA certificate that you used to sign the keystore of the Kafka cluster and the database cluster. If you are using more than one CA to sign your certificates, add all of the CAs you used.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ &lt;span class=&#34;code-input&#34;&gt;keytool -keystore scheduler.truststore.jks -alias CARoot -import \
               -file root.crt&lt;/span&gt;
Enter keystore password: &lt;span class=&#34;code-variable&#34;&gt;some_password&lt;/span&gt;
Re-enter new password: &lt;span class=&#34;code-variable&#34;&gt;some_password&lt;/span&gt;
Owner: EMAILADDRESS=myemail@mycompany.com, CN=*.mycompany.com, O=MyCompany, L=Cambridge, ST=MA, C=US
Issuer: EMAILADDRESS=myemail@mycompany.com, CN=*.mycompany.com, O=MyCompany, L=Cambridge, ST=MA, C=US
Serial number: c3f02e87707d01aa
Valid from: Fri Mar 22 13:37:37 EDT 2019 until: Sun Apr 21 13:37:37 EDT 2019
Certificate fingerprints:
         MD5:  73:B1:87:87:7B:FE:F1:6E:94:55:FD:AF:5D:D0:C3:0C
         SHA1: C0:69:1C:93:54:21:87:C7:03:93:FE:39:45:66:DE:22:18:7E:CD:94
         SHA256: 23:03:BB:B7:10:12:50:D9:C5:D0:B7:58:97:41:1E:0F:25:A0:DB:
                 D0:1E:7D:F9:6E:60:8F:79:A6:1C:3F:DD:D5
Signature algorithm name: SHA256withRSA
Subject Public Key Algorithm: 2048-bit RSA key
Version: 3

Extensions:

#1: ObjectId: 2.5.29.35 Criticality=false
AuthorityKeyIdentifier [
KeyIdentifier [
0000: 50 69 11 64 45 E9 CC C5   09 EE 26 B5 3E 71 39 7C  Pi.dE.....&amp;amp;.&amp;gt;q9.
0010: E5 3D 78 16                                        .=x.
]
]

#2: ObjectId: 2.5.29.19 Criticality=false
BasicConstraints:[
  CA:true
  PathLen:2147483647
]

#3: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 50 69 11 64 45 E9 CC C5   09 EE 26 B5 3E 71 39 7C  Pi.dE.....&amp;amp;.&amp;gt;q9.
0010: E5 3D 78 16                                        .=x.
]
]

Trust this certificate? [no]:  &lt;span class=&#34;code-input&#34;&gt;yes&lt;/span&gt;
Certificate was added to keystore
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Initialize the keystore, passing it a wildcard host name as the Common Name. The alias parameter in this command is important, as you use it later to identify the key the scheduler must use when creating SSL conections:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;keytool -keystore scheduler.keystore.jks -alias vsched -validity 365 -genkey \
        -keyalg RSA  -dname CN=*.mycompany.com
&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
&lt;p&gt;If you choose to use a file format other than the standard Java Keystore (JKS) format for your keystore or truststore files, you must use the correct file extension in the filename. For example, suppose you choose to use a keystore and truststore saved in PKCS#12 format. Then your keystore and trustore files must end with the &lt;code&gt;.pfx&lt;/code&gt; or &lt;code&gt;.p12&lt;/code&gt; extension.&lt;/p&gt;
&lt;p&gt;If the scheduler does not recognize the file&#39;s extension (or there is no extension in the file name), it assumes that the file is in JKS format. If the file is not in JKS format, you will see an error message when starting the scheduler, similar to &amp;quot;Failed to create an SSLSocketFactory when setting up TLS: keystore not found.&amp;quot;&lt;/p&gt;

&lt;/div&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Export the scheduler&#39;s key so you can sign it with the root CA:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ keytool -keystore scheduler.keystore.jks -alias vsched -certreq \
        -file scheduler.unsigned.cert
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Sign the scheduler key with the root CA:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ openssl x509 -req -CA root.crt -CAkey root.key -in scheduler.unsigned.cert \
        -out scheduler.signed.cert -days 365 -CAcreateserial
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Re-import the scheduler key into the keystore:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ keytool -keystore scheduler.keystore.jks -alias localhost -import -file scheduler.signed.cert
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;set-environment-variable-vkconfig_jvm_opts&#34;&gt;Set environment variable VKCONFIG_JVM_OPTS&lt;/h3&gt;
&lt;p&gt;You must pass several settings to the JDBC interface of the Java Virtual Machine (JVM) that runs the scheduler. These settings tell the JDBC driver where to find the keystore and truststore, as well as the key&#39;s password. The easiest way to pass in these settings is to set a Linux environment variable named VKCONFIG_JVM_OPTS. As it starts, the scheduler checks this environment variable and passes any properties defined in it to the JVM.&lt;/p&gt;
&lt;p&gt;The properties that you need to set are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;javax.net.ssl.keystore: the absolute path to the keystore file to use.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;javax.net.ssl.keyStorePassword: the password for the scheduler&#39;s key.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;javax.net.ssl.trustStore: The absolute path to the truststore file.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The Linux command line to set the environment variable is:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;export VKCONFIG_JVM_OPTS=&amp;#34;$VKCONFIG_JVM_OPTS -Djavax.net.ssl.trustStore=&lt;span class=&#34;code-variable&#34;&gt;/path/to/truststore&lt;/span&gt; \
                          -Djavax.net.ssl.keyStore=&lt;span class=&#34;code-variable&#34;&gt;/path/to/keystore&lt;/span&gt; \
                          -Djavax.net.ssl.keyStorePassword=&lt;span class=&#34;code-variable&#34;&gt;keystore_password&lt;/span&gt;&amp;#34;
&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

The previous command preserves any existing contents of the VKCONFIG_JVM_OPTS variable. If you find the variable has duplicate settings, remove the &lt;code&gt;$VKCONFIG_JVM_OPTS&lt;/code&gt; from your statement so you override the existing values in the variable.

&lt;/div&gt;
&lt;p&gt;For example, suppose the scheduler&#39;s truststore and keystore are located in the directory &lt;code&gt;/home/dbadmin/SSL&lt;/code&gt;. Then you could use the following command to set the VKCONFIG_JVM_OPTS variable:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ export VKCONFIG_JVM_OPTS=&amp;#34;$VKCONFIG_JVM_OPTS \
                           -Djavax.net.ssl.trustStore=/home/dbadmin/SSL/scheduler.truststore.jks \
                           -Djavax.net.ssl.keyStore=/home/dbadmin/SSL/scheduler.keystore.jks \
                           -Djavax.net.ssl.keyStorePassword=&lt;span class=&#34;code-variable&#34;&gt;key_password&lt;/span&gt;&amp;#34;
&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
The Java property names are case sensitive.
&lt;/div&gt;
&lt;p&gt;To ensure that this variable is always set, add the command to the &lt;code&gt;~/.bashrc&lt;/code&gt; or other startup file of the user account that runs the scheduler.&lt;/p&gt;
&lt;p&gt;If you require TLS on the JDBC connection to OpenText™ Analytics Database, add &lt;code&gt;TLSmode=require&lt;/code&gt; to the JDBC URL that the scheduler uses. The easiest way to add this is to use the scheduler&#39;s &lt;code&gt;--jdbc-url&lt;/code&gt; option. Assuming that you use a configuration file for your scheduler, you can add this line to it:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;--jdbc-url=jdbc:vertica://VerticaHost:portNumber/databaseName?user=&lt;span class=&#34;code-variable&#34;&gt;username&lt;/span&gt;&amp;amp;password=&lt;span class=&#34;code-variable&#34;&gt;password&lt;/span&gt;&amp;amp;&lt;span class=&#34;code-input&#34;&gt;TLSmode=&lt;span class=&#34;code-variable&#34;&gt;require&lt;/span&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;For more information about using JDBC with OpenText™ Analytics Database, see &lt;a href=&#34;../../../en/connecting-to/client-libraries/accessing/java/#&#34;&gt;Java&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;enable-tls-in-the-scheduler-configuration&#34;&gt;Enable TLS in the scheduler configuration&lt;/h3&gt;
&lt;p&gt;Lastly, enable TLS. Every time you run &lt;code&gt;vkconfig&lt;/code&gt;, you must pass it the following options:&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;--enable-ssl&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;code&gt;true&lt;/code&gt;, to enable the scheduler to use SSL when connecting to Kafka.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;--ssl-ca-alias&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Alias for the CA you used to sign your Kafka broker&#39;s keys. This must match the value you supplied to the &lt;code&gt;-alias&lt;/code&gt; argument of the keytool command to import the CA into the truststore.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

If you used more than one CA to sign keys, omit this option to import all of the CAs into the truststore.

&lt;/div&gt;&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;--ssl-key-alias&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Alias assigned to the schedule key. This value must match the value you supplied to the -alias you supplied to the keytool command when creating the scheduler&#39;s keystore.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;--ssl-key-password&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Password for the scheduler key.&lt;/dd&gt;
&lt;/dl&gt;
&lt;p&gt;See &lt;a href=&#34;../../../en/kafka-integration/vkconfig-script-options/common-vkconfig-script-options/#&#34;&gt;Common vkconfig script options&lt;/a&gt; for details of these options. For convenience and security, add these options to a configuration file that you pass to vkconfig. Otherwise, you run the risk of exposing the key password via the process list which can be viewed by other users on the same system. See &lt;a href=&#34;../../../en/kafka-integration/vkconfig-script-options/common-vkconfig-script-options/#Configur&#34;&gt;Configuration File Format&lt;/a&gt; for more information on setting up a configuration file.&lt;/p&gt;
&lt;p&gt;Add the following to the scheduler configuration file to allow it to use the keystore and truststore and enable TLS when connecting to the database:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;enable-ssl=true
ssl-ca-alias=CAroot
ssl-key-alias=vsched
ssl-key-password=vertica
jdbc-url=jdbc:vertica://VerticaHost:portNumber/databaseName?user=&lt;span class=&#34;code-variable&#34;&gt;username&lt;/span&gt;&amp;amp;password=&lt;span class=&#34;code-variable&#34;&gt;password&lt;/span&gt;&amp;amp;TLSmode=&lt;span class=&#34;code-variable&#34;&gt;require&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;start-the-scheduler&#34;&gt;Start the scheduler&lt;/h3&gt;
&lt;p&gt;Once you have configured the scheduler to use SSL, start it and verify that it can load data. For example, to start the scheduler with a configuration file named &lt;code&gt;weblog.conf&lt;/code&gt;, use the command:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ nohup vkconfig launch --conf weblog.conf &amp;gt;/dev/null 2&amp;gt;&amp;amp;1 &amp;amp;
&lt;/code&gt;&lt;/pre&gt;

      </description>
    </item>
    
    <item>
      <title>Kafka-Integration: Troubleshooting Kafka TLS/SSL connection issues</title>
      <link>/en/kafka-integration/tlsssl-encryption-with-kafka/troubleshooting-kafka-tlsssl-connection-issues/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/kafka-integration/tlsssl-encryption-with-kafka/troubleshooting-kafka-tlsssl-connection-issues/</guid>
      <description>
        
        
        &lt;p&gt;After configuring OpenText™ Analytics Database, Kafka, and your scheduler to use TLS/SSL authentication and encryption, you may encounter issues with data streaming. This section explains some of the more common errors you may encounter, and how to trouble shoot them.&lt;/p&gt;
&lt;h2 id=&#34;errors-when-launching-the-scheduler&#34;&gt;Errors when launching the scheduler&lt;/h2&gt;
&lt;p&gt;You may see errors like this when launching the scheduler:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ vkconfig launch --conf weblog.conf
java.sql.SQLNonTransientException: com.vertica.solutions.kafka.exception.ConfigurationException:
       No keystore system property found: null
    at com.vertica.solutions.kafka.util.SQLUtilities.getConnection(SQLUtilities.java:181)
    at com.vertica.solutions.kafka.cli.CLIUtil.assertDBConnectionWorks(CLIUtil.java:40)
    at com.vertica.solutions.kafka.Launcher.run(Launcher.java:135)
    at com.vertica.solutions.kafka.Launcher.main(Launcher.java:263)
Caused by: com.vertica.solutions.kafka.exception.ConfigurationException: No keystore system property found: null
    at com.vertica.solutions.kafka.security.KeyStoreUtil.loadStore(KeyStoreUtil.java:77)
    at com.vertica.solutions.kafka.security.KeyStoreUtil.&amp;lt;init&amp;gt;(KeyStoreUtil.java:42)
    at com.vertica.solutions.kafka.util.SQLUtilities.getConnection(SQLUtilities.java:179)
    ... 3 more
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The scheduler throws these errors when it cannot locate or read the keystore or truststore files. To resolve this issue:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Verify you have set the VKCONFIG_JVM_OPTS Linux environment variable. Without this variable, the scheduler will not know where to find the truststore and keystore to use when creating TLS/SSL connections. See &lt;a href=&#34;../../../en/kafka-integration/tlsssl-encryption-with-kafka/configure-kafka-tls/#vkconfigjvm&#34;&gt;Step 2: Set the VKCONFIG_JVM_OPTS Environment Variable&lt;/a&gt; for more information.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Verify that the keystore and truststore files are located in the path you set in the VKCONFIG_JVM_OPTS environment variable.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Verify that the user account that runs the scheduler has read access to the trustore and keystore files.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Verify that the key password you provide in the scheduler configuration is correct. Note that you must supply the password for the key, not the keystore.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Another possible error message is a failure to set up a TLS Keystore:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Exception in thread &amp;#34;main&amp;#34; java.sql.SQLRecoverableException: [Vertica][VJDBC](100024) IOException while communicating with server: java.io.IOException: Failed to create an SSLSocketFactory when setting up TLS: keystore not found.
        at com.vertica.io.ProtocolStream.logAndConvertToNetworkException(Unknown Source)
        at com.vertica.io.ProtocolStream.enableSSL(Unknown Source)
        at com.vertica.io.ProtocolStream.initSession(Unknown Source)
        at com.vertica.core.VConnection.tryConnect(Unknown Source)
        at com.vertica.core.VConnection.connect(Unknown Source)
        . . .
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This error can be caused by using a keystore or truststore file in a format other than JKS and not supplying the correct file extension. If the scheduler does not recognize the file extension of your keystore or truststore file name, it assumes the file is in JKS format. If the file isn&#39;t in this format, the scheduler will exit with the error message shown above. To correct this error, rename the keystore and truststore files to use the correct file extension. For example, if your files are in PKCS 12 filemat, change their file extension to &lt;code&gt;.p12&lt;/code&gt; or &lt;code&gt;.pks&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;data-does-not-load&#34;&gt;Data does not load&lt;/h2&gt;
&lt;p&gt;If you find that scheduler is not loading data into your database, you should first query the &lt;a href=&#34;../../../en/kafka-integration/data-streaming-schema-tables/stream-microbatch-history/#&#34;&gt;stream_microbatch_history&lt;/a&gt; table to determine whether the scheduler is executing microbatches, and if so, what their results are. A faulty TLS/SSL configuration usually results in a status of NETWORK_ISSUE:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT frame_start, end_reason, end_reason_message FROM weblog_sched.stream_microbatch_history;
       frame_start       |  end_reason   | end_reason_message
-------------------------+---------------+--------------------
 2019-04-05 11:35:18.365 | NETWORK_ISSUE |
 2019-04-05 11:35:38.462 | NETWORK_ISSUE |
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you suspect an SSL issue, you can verify that the database is establishing a connection to Kafka by looking at Kafka&#39;s &lt;code&gt;server.log&lt;/code&gt; file. Failed SSL connection attempts can appear in this log like this example:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;java.io.IOException: Unexpected status returned by SSLEngine.wrap, expected
        CLOSED, received OK. Will not send close message to peer.
        at org.apache.kafka.common.network.SslTransportLayer.close(SslTransportLayer.java:172)
        at org.apache.kafka.common.utils.Utils.closeAll(Utils.java:703)
        at org.apache.kafka.common.network.KafkaChannel.close(KafkaChannel.java:61)
        at org.apache.kafka.common.network.Selector.doClose(Selector.java:739)
        at org.apache.kafka.common.network.Selector.close(Selector.java:727)
        at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:520)
        at org.apache.kafka.common.network.Selector.poll(Selector.java:412)
        at kafka.network.Processor.poll(SocketServer.scala:551)
        at kafka.network.Processor.run(SocketServer.scala:468)
        at java.lang.Thread.run(Thread.java:748)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you do not see errors of this sort, you likely have a network problem between Kafka and the database. If you do see these errors, consider the following debugging steps:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Verify that the configuration of your Kafka cluster is uniform. For example, you may see connection errors if some Kafka nodes are set to require client authentication and others aren&#39;t.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Verify that the Common Names (CN) in the certificates and keys match the host name of the system.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Verify that the Kafka cluster is accepting connections on the ports and host names you specify in the &lt;code&gt;server.properties&lt;/code&gt; file&#39;s listeners property. For example, suppose you use IP addresses in this setting, but use host names when defining the cluster in the scheduler&#39;s configuration. Then Kafka may reject the connection attempt by the database or the database may reject the Kafka node&#39;s identity.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you are using client authentication in Kafka, try turning it off to see if the scheduler can connect. If disabling authentication allows the scheduler to stream data, then you can isolate the problem to client authentication. In this case, review the certificates and CAs of both the Kafka cluster and the scheduler. Ensure that the truststores include all of the CAs used to sign the key, up to and including the root CA.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;avro-schema-registry-and-kafkaavroparser&#34;&gt;Avro schema registry and KafkaAvroParser&lt;/h2&gt;
&lt;p&gt;At minimum, the &lt;a href=&#34;../../../en/kafka-integration/kafka-function-reference/kafkaavroparser/#&#34;&gt;KafkaAvroParser&lt;/a&gt; requires the following parameters to create a TLS connection between the Avro Schema Registry and the database:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;schema_registry_url&lt;/code&gt; with the https scheme&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;schema_registry_ssl_ca_path&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If and only if TLS access fails, determine what TLS schema registry information the database requires from the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Certificate Authority (CA)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;TLS server certificate&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;TLS key&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Provide only the necessary TLS schema registry information with KafkaAvroParser parameters. The TLS information must be accessible in the filesystem of each database node that processes Avro data.&lt;/p&gt;
&lt;p&gt;The following example shows how to pass these parameters to KafkaAvroParser:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;KafkaAvroParser(
    schema_registry_url=&amp;#39;https://localhost:8081&amp;#39;
    schema_registry_ssl_ca_path=&amp;#39;&lt;span class=&#34;code-variable&#34;&gt;path&lt;/span&gt;/&lt;span class=&#34;code-variable&#34;&gt;to&lt;/span&gt;/&lt;span class=&#34;code-variable&#34;&gt;certificate-authority&lt;/span&gt;&amp;#39;,
    schema_registry_ssl_cert_path=&amp;#39;&lt;span class=&#34;code-variable&#34;&gt;path&lt;/span&gt;/&lt;span class=&#34;code-variable&#34;&gt;to&lt;/span&gt;/&lt;span class=&#34;code-variable&#34;&gt;tls-server-certificate&lt;/span&gt;&amp;#39;,
    schema_registry_ssl_key_path=&amp;#39;&lt;span class=&#34;code-variable&#34;&gt;path&lt;/span&gt;/&lt;span class=&#34;code-variable&#34;&gt;to&lt;/span&gt;/&lt;span class=&#34;code-variable&#34;&gt;private-tls-key&lt;/span&gt;&amp;#39;,
    schema_registry_ssl_key_password_path=&amp;#39;&lt;span class=&#34;code-variable&#34;&gt;path&lt;/span&gt;/&lt;span class=&#34;code-variable&#34;&gt;to&lt;/span&gt;/&lt;span class=&#34;code-variable&#34;&gt;private-tls-key-password&lt;/span&gt;&amp;#39;
)
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
  </channel>
</rss>
