<?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>Question Re: Unable to logon to ASE with Interactive SQL using SSL in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/unable-to-logon-to-ase-with-interactive-sql-using-ssl/qaa-p/14003103#M4901459</link>
    <description>&lt;P&gt;ASE 16.0 SP02PL07 is over 7 years old.&amp;nbsp; It used a cryptographic library that was replaced in SP03 and higher.&amp;nbsp; This may account for the fact that you could connect with the native isql, but not with Windows.&lt;/P&gt;&lt;P&gt;There are also many security fixes.&lt;/P&gt;&lt;P&gt;The other issue is that SDK 20 should not be used.&amp;nbsp; It is actually older than current SDK 16.0 releases, despite the version numbering and uses DBISQL 16.0, not the current DBISQL 17.&amp;nbsp; Despite the difference in release number, I would recommend the following:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Upgrade your ASE instance to a newer version - SP03 PL15 or SP04PL06 HF1.&lt;/LI&gt;&lt;LI&gt;Upgrade your Windows SDK installation to a newer version of 16.0 SDK.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Try your connectivity tests again.&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
    <pubDate>Fri, 31 Jan 2025 14:58:43 GMT</pubDate>
    <dc:creator>ChrisBaker</dc:creator>
    <dc:date>2025-01-31T14:58:43Z</dc:date>
    <item>
      <title>Unable to logon to ASE with Interactive SQL using SSL</title>
      <link>https://community.sap.com/t5/technology-q-a/unable-to-logon-to-ase-with-interactive-sql-using-ssl/qaq-p/14002093</link>
      <description>&lt;P&gt;Hello everyone. I am struggling to connect to my ASE instance via Interactive SQL using SSL encryption.&lt;/P&gt;&lt;P&gt;For the client application I use Sybase SDK 20_0 on Win Server 2012. The version of the Interactive SQL is 16.0.0 build 2909.&lt;/P&gt;&lt;P&gt;My ASE instance is of 16.0 SP02 PL07 running on AIX 7.2.&lt;/P&gt;&lt;P&gt;I have everything set up. That is:&lt;/P&gt;&lt;P&gt;1. sp_configure 'enable ssl',1&lt;/P&gt;&lt;P&gt;2. the master and query lines in interfaces file contain the filter ssl="CN='$DSQUERY'"&lt;/P&gt;&lt;P&gt;3. Have self-signed client certficate in $SYBASE/$SYBASE_ASE/certficates/$DSQUERY.txt&lt;/P&gt;&lt;P&gt;4. Have the root.crt certificate appended to $SYBASE/config/trusted.txt&lt;/P&gt;&lt;P&gt;5. Have the self-signed server certificate in Have the required self-signed certficate in $SYBASE/$SYBASE_ASE/certficates/$DSQUERY.crt&lt;/P&gt;&lt;P&gt;6. Have the $DSQUERY.crt certificate added with sp_ssladmin 'addcert'&lt;/P&gt;&lt;P&gt;7. have the protocol set with sp_ssladmin 'setprotocol' to 'TLS1.2'&lt;/P&gt;&lt;P&gt;8. Have the ciphersuite set with sp_ssladmin 'setcipher' to 'Strong'&lt;/P&gt;&lt;P&gt;9. Overwritten the Interactive SQL trusted file in %SYBASE%\ini\trusted.txt with $SYBASE/config/trusted.txt from ASE's host machine&lt;/P&gt;&lt;P&gt;10. Imported the client&amp;nbsp; $DSQUERY.txt certficate to java's keystore located in SDK's folder %SYBASE%\Shared\SAPJRE-8_1_076_64BIT\lib\security using keytool as below:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;keytool -importcert -alias "&amp;lt;asename&amp;gt;" -trustcacerts -noprompt -file %SYBASE%\ini\&amp;lt;asename&amp;gt;.txt -keystore %SYBASE%\Shared\SAPJRE-8_1_076_64BIT\lib\security\cacerts -storepass changeit&lt;/P&gt;&lt;P&gt;11. Removed all certificates with elliptic curves encryption algorithms from the keystore like SHA256withECDSA and SHA384withECDSA:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;"thawteprimaryrootcag2"&lt;BR /&gt;"geotrustprimarycag2"&lt;BR /&gt;"verisignclass3_g4"&lt;BR /&gt;"usertrusteccca [jdk]"&lt;BR /&gt;"comodoeccca [jdk]"&lt;BR /&gt;"globalsigneccrootcar4"&lt;BR /&gt;"digicertglobalrootg3 [jdk]"&lt;BR /&gt;"digicertassuredidg3 [jdk]"&lt;BR /&gt;"globalsigneccrootcar5"&lt;BR /&gt;"entrustrootcaec1 [jdk]"&lt;BR /&gt;"affirmtrustpremiumeccca [jdk]"&lt;BR /&gt;"sslrooteccca [jdk]"&lt;BR /&gt;"amazonrootca4 [jdk]"&lt;BR /&gt;"amazonrootca3 [jdk]"&lt;BR /&gt;"haricaeccrootca2015 [jdk]"&lt;/P&gt;&lt;P&gt;Basically for the certifacate generation I followed these SAP Notes:&lt;/P&gt;&lt;P&gt;&lt;A href="https://me.sap.com/notes/2593925" target="_blank" rel="noopener"&gt;https://me.sap.com/notes/2593925&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://me.sap.com/notes/1899365" target="_blank" rel="noopener"&gt;https://me.sap.com/notes/1899365&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The result is that I am able to logon from the ASE host machine via SSL using isql command line client targeting the hostmachine with its network name (not localhost), e.g.&lt;/P&gt;&lt;P&gt;isql -U &amp;lt;user&amp;gt; -P &amp;lt;password&amp;gt; -S '&amp;lt;hostname&amp;gt; &amp;lt;port&amp;gt; ssl="CN=$DSQUERY"'&lt;/P&gt;&lt;P&gt;the @@ssl_cihersuire variable gives me back ' TLS_RSA_WITH_AES_256_GCM_SHA384' which means that the connection is SSL-encrypted.&lt;/P&gt;&lt;P&gt;On the remote Windows server, where I have the Interactive SQL installed , I am also able to logon with SSL via isql command line client by simply ASE name in the -S flag, not the host name followed by port and ssl filter as in above isql example from AIX.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;On the Interactive SQL logon page I have the ASE name, host name and port selected correctly, the SSL checkbox next to port number field is also checked (the master and query lines in sql.ini file aslo have the proper ssl filter. But upon logon I get :&lt;/P&gt;&lt;P&gt;Connection refused. Ensure that the name in the 'Server name' file is correct and that the server has been started.&lt;/P&gt;&lt;P&gt;Here is the error:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;JZ006: Caught IOException: java.io.IOException: JZ0T3 use getCause() to see the error chain&lt;BR /&gt;SQLCODE=0&lt;BR /&gt;SQLSTATE=JZ006&lt;BR /&gt;JZ0T3: Read operation timed out.&lt;BR /&gt;SQLCODE=0&lt;BR /&gt;SQLSTATE=JZ0T3&lt;/P&gt;&lt;P&gt;Connection parameters:&lt;BR /&gt;User=&amp;lt;user&amp;gt;&lt;BR /&gt;Password=&amp;lt;pasword&amp;gt;&lt;BR /&gt;ENG=ASEname&lt;/P&gt;&lt;P&gt;Here is the connection string:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Attempted to connect using:&lt;BR /&gt;HOSTNAME=&amp;lt;hostname&amp;gt;;JCONNECT_VERSION=0;USER=&amp;lt;user&amp;gt;;SERVICEFILTER=ssl;ENABLE_SSL=true;RETRY_WITH_NO_ENCRYPTION=true;ENCRYPT_PASSWORD=true;SERVERNAME=&amp;lt;ASEname&amp;gt;;PWD=***;&amp;lt;HOST&amp;gt;=&amp;lt;host_name&amp;gt;;&amp;lt;PORT&amp;gt;=&amp;lt;port_number&amp;gt;&lt;BR /&gt;JZ006: Caught IOException: java.io.IOException: JZ0T3 use getCause() to see the error chain&lt;/P&gt;&lt;P&gt;Note that I have masked the hostname, user, host and port fields obviously.&lt;/P&gt;&lt;P&gt;What am I doing wrong, what am I missing. Thank you in advance for any help !&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 30 Jan 2025 18:21:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/unable-to-logon-to-ase-with-interactive-sql-using-ssl/qaq-p/14002093</guid>
      <dc:creator>elovelo</dc:creator>
      <dc:date>2025-01-30T18:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to logon to ASE with Interactive SQL using SSL</title>
      <link>https://community.sap.com/t5/technology-q-a/unable-to-logon-to-ase-with-interactive-sql-using-ssl/qaa-p/14003054#M4901454</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Java applications like DBISQL / Interactive SQL use the keystore to login with ssl.&lt;/P&gt;&lt;P&gt;isql uses the trusted.txt file as you pointed out.&lt;/P&gt;&lt;P&gt;If isql works then the trusted.txt file has the correct ssl certificates.&lt;/P&gt;&lt;P&gt;For java you import the ssl certificate into the keystore, but this command only imports the top certificate with keytool.&lt;BR /&gt;I'm guessing that the ssl certificate may not be at the top or only part of the ssl chain was imported into the keystore.&lt;BR /&gt;Try to seperate the ssl certificates into files and the import them into the keystore.&lt;/P&gt;&lt;P&gt;This is easier to debug with ASE 16.0 SP03+ as it uses the SAP Common Crypto Libraries (CCL).&lt;BR /&gt;KBA# 2743343&lt;BR /&gt;&lt;A href="https://me.sap.com/notes/2743343" target="_blank" rel="noopener"&gt;https://me.sap.com/notes/2743343&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You may be able to turn on the ASE traceflags for more information though.&lt;/P&gt;&lt;PRE&gt;7825	Verbose SSL activity, including packet dumps.
7826	Trace memory alloc/free for SSL. Verbose.
7827	Trace entry/exit for SSL.
7828	Verbose HBC.
7829	Trace certificate authentication for SSL.&lt;/PRE&gt;&lt;P&gt;1&amp;gt; dbcc traceon(7829)&lt;BR /&gt;These output to a cmd prompt/log file&lt;/P&gt;&lt;PRE&gt;3604	output traceprint to network
3605	output traceprint to errorlog&lt;/PRE&gt;&lt;P&gt;Also, this syntax works on windows with backslashes&lt;BR /&gt;&lt;SPAN&gt;isql -U &amp;lt;user&amp;gt; -P &amp;lt;password&amp;gt; -S "&amp;lt;hostname&amp;gt; &amp;lt;port&amp;gt; ssl=\"CN=ASECommonName\""&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;BR /&gt;Ryan&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2025 14:37:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/unable-to-logon-to-ase-with-interactive-sql-using-ssl/qaa-p/14003054#M4901454</guid>
      <dc:creator>ryan_hansen</dc:creator>
      <dc:date>2025-01-31T14:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to logon to ASE with Interactive SQL using SSL</title>
      <link>https://community.sap.com/t5/technology-q-a/unable-to-logon-to-ase-with-interactive-sql-using-ssl/qaa-p/14003103#M4901459</link>
      <description>&lt;P&gt;ASE 16.0 SP02PL07 is over 7 years old.&amp;nbsp; It used a cryptographic library that was replaced in SP03 and higher.&amp;nbsp; This may account for the fact that you could connect with the native isql, but not with Windows.&lt;/P&gt;&lt;P&gt;There are also many security fixes.&lt;/P&gt;&lt;P&gt;The other issue is that SDK 20 should not be used.&amp;nbsp; It is actually older than current SDK 16.0 releases, despite the version numbering and uses DBISQL 16.0, not the current DBISQL 17.&amp;nbsp; Despite the difference in release number, I would recommend the following:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Upgrade your ASE instance to a newer version - SP03 PL15 or SP04PL06 HF1.&lt;/LI&gt;&lt;LI&gt;Upgrade your Windows SDK installation to a newer version of 16.0 SDK.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Try your connectivity tests again.&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2025 14:58:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/unable-to-logon-to-ase-with-interactive-sql-using-ssl/qaa-p/14003103#M4901459</guid>
      <dc:creator>ChrisBaker</dc:creator>
      <dc:date>2025-01-31T14:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to logon to ASE with Interactive SQL using SSL</title>
      <link>https://community.sap.com/t5/technology-q-a/unable-to-logon-to-ase-with-interactive-sql-using-ssl/qaa-p/14003263#M4901465</link>
      <description>&lt;P&gt;Hello Ryan and thank you ! You were right about the ssl client certifcate ($DSQUERY.txt) designated for the import to the java keystore. It not only contained the client certificate that I created but also other certificates that my ASE uses to authenticate users via AD/LDAP. And indeed, that client certificate was appended to the bottom of the file (obviously). I extracted it into a separate file and imported only this file to the keystore. No I am able to logon with SSL through Interactive SQL &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;I was able to check which certificate in the chain was the client certificate by running this command on the $DSQUERY.txt file&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="bash"&gt;f=$SYBASE/$SYBASE_ASE/certificates/$DSQUERY.txt
i=`grep -c 'BEGIN CERTIFICATE' $f`
while [ $i -gt 0 ]; do
awk "BEGIN{nr=$i;i=0}"'/BEGIN CERTIFICATE/{nr--;i=1}nr==0&amp;amp;&amp;amp;i==1{print $0}/END CERTIFICATE/{i=0}' $f | \
$SAP_JRE8/bin/keytool -printcert | head -n 10
i=$((i - 1)) # Correct way to decrement in ksh
done&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I sourced this command from the SSL troubleshooting note 3152010&amp;nbsp; - &lt;A href="https://me.sap.com/notes/3152010/E" target="_blank" rel="noopener"&gt;https://me.sap.com/notes/3152010/E&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Note: you may need to replace the 'let i--' with '$((i - 1))' for it to work&lt;/P&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2025 16:30:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/unable-to-logon-to-ase-with-interactive-sql-using-ssl/qaa-p/14003263#M4901465</guid>
      <dc:creator>elovelo</dc:creator>
      <dc:date>2025-01-31T16:30:16Z</dc:date>
    </item>
  </channel>
</rss>

