I am trying to connect to DB2 version 11.x on linux from my local windows machine. Ran below command in by ibm's jre/bin, but still getting an error.
Command
C:\Program Files (x86)**>java com.ibm.db2.jcc.DB2Jcc -url "jdbc:db2://serverip:50001/dbname:sslConnection=true;sslCertLocation=D:\path_to_certificate;" -user dbusername -password dbpassword
Error
[jcc][10512][13714]Failed to create connection. SQLCODE: -4499 SQLSTATE: 08001 Message: [jcc][t4][2030][11211][4.25.13] A communication error occurred during operations on the connection's underlying socket, socket input stream, or socket output stream. Error location: Reply.fill() - socketInputStream.read (-1). Message: Received fatal alert: handshake_failure. ERRORCODE=-4499, SQLSTATE=08001
Note - I have given .cer
certificate file in certificate path (As in this example, .arm
is given), will it matter?
What am I doing wrong?
Analysis 1 Ran below command on path, output is :
Command
java com.ibm.db2.jcc.DB2Jcc -version
Output
IBM Data Server Driver for JDBC and SQLJ 4.25.13
That proves JCC version is correct (More than 4.1)
Analysis 2
Ran telnet from local windows machine towards DB2 linux machine on desired TLSv1.2 enabled port. It is success.
-
What port is your Db2 running on, and what port are you trying to connect to?Lennart - Slava Ukraini– Lennart - Slava Ukraini2020年02月06日 11:12:46 +00:00Commented Feb 6, 2020 at 11:12
-
The URL you're connecting to seem incomplete.mustaccio– mustaccio2020年02月06日 12:20:59 +00:00Commented Feb 6, 2020 at 12:20
-
@Lennart - Port is 50001 on which SSL is enabled by DBA team.Vinit More– Vinit More2020年02月06日 14:44:54 +00:00Commented Feb 6, 2020 at 14:44
-
@mustaccio - Have copied whole URL. While posting it somehow removed few bits.Vinit More– Vinit More2020年02月06日 14:46:57 +00:00Commented Feb 6, 2020 at 14:46
-
Still missing the database nameemustaccio– mustaccio2020年02月06日 14:57:57 +00:00Commented Feb 6, 2020 at 14:57