Can't connect to DB2 with DataGrip with securityMechanism=13

1.1k Views Asked by At

I'm trying to make a connection with the DB2 database with DataGrip. For the connection securityMechanism=13 is needed.

The connection failed with the following message:

[-4223] [jcc][1071][10615][3.68.61] Caught java.security.InvalidAlgorithmParameterException while initializing EncryptionManager. See attached Throwable for details. ERRORCODE=-4223, SQLSTATE=null DH key size must be multiple of 64, and can only range from 512 to 8192 (inclusive). The specific key size 256 is not supported.

We used the following string:

 jdbc:db2://<ip-adress>:<port>/<schema>:securityMechanism=13;

When we disable the security measures we can connect to the database, but as soon as the ENCRYPTED_USER_PASSWORD_AND_DATA_SECURITY is enabled, we can't setup a connection.

We also use DataStudio and with this application it is possible to create a jdbc connection to the DB2 database. We prefer to use DataGrip because we need to maintain different types of databases which is not possible in DataStudio.

2

There are 2 best solutions below

0
On

FYI from Security under the IBM Data Server Driver for JDBC and SQLJ

Important: The DATA_ENCRYPT authentication type is deprecated and might be removed in a future release.

To encrypt data in-transit between clients and Db2® on Linux®, UNIX, and Windows systems databases, we recommend that you use the Db2 on Linux, UNIX, and Windows systems database system support of Secure Sockets Layer (SSL).

and from https://www.ibm.com/support/pages/jdbc-data-encrypt

Data_encrypt is not supported db2 v11 onwards. There is no plan to support DATA_ENCRYPT with openJDK 11. The recommendations is to use SSL.

1
On

DataGrip uses JAVA 11 and DATA_ENCRYPT doesn't support JAVA 11