<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Talend v7.3 Error when connect to postgresDB using SSL in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Talend-v7-3-Error-when-connect-to-postgresDB-using-SSL/m-p/2483959#M141323</link>
    <description>&lt;P&gt;Hi Nuser,&lt;/P&gt;
&lt;P&gt;thank for your reply, let me check it!&lt;/P&gt;</description>
    <pubDate>Fri, 27 Sep 2024 09:04:39 GMT</pubDate>
    <dc:creator>huynhdung</dc:creator>
    <dc:date>2024-09-27T09:04:39Z</dc:date>
    <item>
      <title>Talend v7.3 Error when connect to postgresDB using SSL</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Talend-v7-3-Error-when-connect-to-postgresDB-using-SSL/m-p/2483906#M141321</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;
&lt;P&gt;I need to configure the Postgres DB SSL certificate in Talend for establishing a secure connection with DB from Talend. But the error was occured.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="huynhdung_1-1727414269639.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/172213iA6A829D26A8BC6B4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="huynhdung_1-1727414269639.png" alt="huynhdung_1-1727414269639.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Can you check what wrong with my setting?&lt;BR /&gt;Basic Settings:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="huynhdung_0-1727415657068.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/172225i9825366301BE22CF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="huynhdung_0-1727415657068.png" alt="huynhdung_0-1727415657068.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Advanced Settings:&lt;BR /&gt;"ssl=true&amp;amp;sslmode=verify-ca&amp;amp;sslcert=C:/xxx/postgresql.crt&amp;amp;sslkey=C:/xxx/postgresql.key&amp;amp;sslrootcert=C:/xxx/production_root.crt"&lt;BR /&gt;&lt;BR /&gt;My key worked well with Dbeaver!&lt;BR /&gt;&lt;BR /&gt;If you need more information, please comment!&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2024 05:42:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Talend-v7-3-Error-when-connect-to-postgresDB-using-SSL/m-p/2483906#M141321</guid>
      <dc:creator>huynhdung</dc:creator>
      <dc:date>2024-09-27T05:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: Talend v7.3 Error when connect to postgresDB using SSL</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Talend-v7-3-Error-when-connect-to-postgresDB-using-SSL/m-p/2483935#M141322</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;gt; I need to configure the Postgres DB SSL certificate in Talend for establishing a secure connection with DB from Talend.&lt;/P&gt;
&lt;P&gt;I believe you mean "secure asymmetric authentication".&lt;/P&gt;
&lt;P&gt;Your error looks like an application error to me: do you have some log from your server side? Whats the content of &lt;CODE class="filename"&gt;pg_hba.conf&lt;/CODE&gt;? What's the client configuration related to the ceritificate required from the server?&lt;/P&gt;
&lt;P&gt;An asymmetric authentication doesn't requiere a password.&lt;/P&gt;
&lt;P&gt;BTW, for PGSQL asymmetric auth requieres SSL as transport layer (&lt;A href="https://www.postgresql.org/docs/current/auth-cert.html" target="_blank"&gt;https://www.postgresql.org/docs/current/auth-cert.html&lt;/A&gt;)&lt;/P&gt;
&lt;P&gt;This might also help: &lt;A href="https://www.postgresql.org/docs/current/ssl-tcp.html#SSL-CLIENT-CERTIFICATES" target="_blank"&gt;https://www.postgresql.org/docs/current/ssl-tcp.html#SSL-CLIENT-CERTIFICATES&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2024 07:43:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Talend-v7-3-Error-when-connect-to-postgresDB-using-SSL/m-p/2483935#M141322</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-09-27T07:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: Talend v7.3 Error when connect to postgresDB using SSL</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Talend-v7-3-Error-when-connect-to-postgresDB-using-SSL/m-p/2483959#M141323</link>
      <description>&lt;P&gt;Hi Nuser,&lt;/P&gt;
&lt;P&gt;thank for your reply, let me check it!&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2024 09:04:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Talend-v7-3-Error-when-connect-to-postgresDB-using-SSL/m-p/2483959#M141323</guid>
      <dc:creator>huynhdung</dc:creator>
      <dc:date>2024-09-27T09:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: Talend v7.3 Error when connect to postgresDB using SSL</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Talend-v7-3-Error-when-connect-to-postgresDB-using-SSL/m-p/2484153#M141326</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/314624"&gt;@huynhdung&lt;/a&gt;&amp;nbsp;,I double checked and I was not aware that the client certificate authentication is part of TLS layer negotiation, so my previous comment might be not completely correct.&lt;/P&gt;
&lt;P&gt;At this point, I believe your error is definitively connected to the certificates used in the mTLS authentication.&lt;/P&gt;
&lt;P&gt;I did some tests (under Linux and with PEM format) and the environment below worked fine for me - it's not a production environment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1 - Creating the CA certificate on server machine:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;openssl req -new -nodes -text -out root.csr -keyout root.key -subj "/CN=192.168.1.71"

chmod og-rwx root.key

openssl x509 -req -in root.csr -text -days 3650 -extfile /etc/ssl/openssl.cnf -extensions v3_ca -signkey root.key -out root.crt&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2 - Creating the server's CSR and the certificate on server machine:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;openssl req -new -nodes -text -out server.csr -keyout server.key -subj "/CN=192.168.1.70"

chmod og-rwx server.key

openssl x509 -req -in server.csr -text -days 365 -CA root.crt -CAkey root.key -CAcreateserial -out server.crt&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3 - Creating client's CSR on client machine:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;openssl req -new -nodes -text -out client.csr -keyout client.key -subj "/CN=user"

chmod og-rwx client.key
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4 - Move the client's CSR (client.csr) on the server and create the client certificate on server machine:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;openssl x509 -req -in client.csr -text -days 365 -CA root.crt -CAkey root.key -CAcreateserial -out client.crt&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;5 - Move the client certificate (client.crt) and the CA root certificate (root.crt) on the client machine.&lt;/P&gt;
&lt;P&gt;6 -&amp;nbsp; Configuring postgresql.conf on server machine:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;# - SSL -

ssl = on
ssl_ca_file = 'root.crt'
ssl_cert_file = 'server.crt'
ssl_key_file = 'server.key'&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;7 - Configuring pg_hba.conf on server machine:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;hostssl  all  user  127.0.0.1/32  cert  clientcert=verify-full&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, you should have your environment configured and from the client machine you should be able to authenticate throught certificate (mTLS).&lt;/P&gt;
&lt;P&gt;In my environment it works with the following command:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;psql 'host=127.0.0.1 port=5432 dbname=postgres user=user sslcert=client.crt sslkey=client.key sslrootcert=root.crt'&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Back to the error you posted &lt;EM&gt;"connection require a valid client certificate",&lt;/EM&gt;&amp;nbsp;it is thrown when the server is expenting a certificate authentication but the client &lt;STRONG&gt;DOESN'T PROVIDE A CERTIFICATE.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;With the previous configured environment is easy to reproduce the error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;psql 'host=127.0.0.1 port=5432 dbname=postgres user=user'          

psql: error: connection to server at "127.0.0.1", port 5432 failed: FATAL:  connection requires a valid client certificate&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At this point I belive there might be two cases here:&lt;/P&gt;
&lt;P data-unlink="true"&gt;&amp;nbsp; &amp;nbsp; 1 - From a client perspective,&lt;STRONG&gt; "sslkey=C:/xxx/postgresql.key"&lt;/STRONG&gt; is not a valid PKCS-8&amp;nbsp;DER format; follow the JDBC documentation to also convert the key:&amp;nbsp;&amp;nbsp;&lt;A href="https://jdbc.postgresql.org/documentation/use/;" target="_blank"&gt;https://jdbc.postgresql.org/documentation/use/;&lt;/A&gt;&amp;nbsp;(&lt;SPAN&gt;openssl pkcs8 -topk8 -inform PEM -in postgresql.key -outform DER -out postgresql.pk8 -v1 PBE-MD5-DES&lt;/SPAN&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; 2 -&amp;nbsp;The client is not able to traslate your advanced commands into the driver so it is not sending a certificate.&lt;/P&gt;
&lt;P&gt;I'm more prone to the #1, but I believe you can troubleshoot it with the following steps:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; 1 - Try to authenticate to your PGSQL server without the JDBC driver and with the current certificate files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; 2 - If it works, try to convert the PEM into a&amp;nbsp;PKCS-8&amp;nbsp;DER format and change the advance configuration of your JDBC driver as following:&lt;STRONG&gt;&amp;nbsp;"sslkey=C:/xxx/postgresql.pk8"&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thnanks for helping me dig deeper and hoping it helps!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I followed this documentation:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://jdbc.postgresql.org/documentation/use/" target="_blank"&gt;https://jdbc.postgresql.org/documentation/use/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.postgresql.org/docs/current/ssl-tcp.html#SSL-CERTIFICATE-CREATION" target="_blank"&gt;https://www.postgresql.org/docs/current/ssl-tcp.html#SSL-CERTIFICATE-CREATION&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Sep 2024 12:47:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Talend-v7-3-Error-when-connect-to-postgresDB-using-SSL/m-p/2484153#M141326</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-09-28T12:47:20Z</dc:date>
    </item>
    <item>
      <title>Re: Talend v7.3 Error when connect to postgresDB using SSL</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Talend-v7-3-Error-when-connect-to-postgresDB-using-SSL/m-p/2484781#M141338</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank for your kind reply!.&lt;BR /&gt;&lt;BR /&gt;For some reason I'm not able to check it now.&lt;/P&gt;
&lt;P&gt;I'm check and come back in several days.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2024 03:19:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Talend-v7-3-Error-when-connect-to-postgresDB-using-SSL/m-p/2484781#M141338</guid>
      <dc:creator>huynhdung</dc:creator>
      <dc:date>2024-10-02T03:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: Talend v7.3 Error when connect to postgresDB using SSL</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Talend-v7-3-Error-when-connect-to-postgresDB-using-SSL/m-p/2486304#M141386</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank for your support, I converted the key then it worked !&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;$ openssl pkcs8 -topk8 -inform PEM -in postgresql.key -outform DER -out postgresql.pk8 -nocrypt&lt;BR /&gt;$ chmod 0600 postgresql.pk8&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Once more time, thanks you!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 02:29:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Talend-v7-3-Error-when-connect-to-postgresDB-using-SSL/m-p/2486304#M141386</guid>
      <dc:creator>huynhdung</dc:creator>
      <dc:date>2024-10-10T02:29:54Z</dc:date>
    </item>
  </channel>
</rss>

