Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handshake_failure #191

Open
oaksofmamre opened this issue Oct 5, 2018 · 0 comments
Open

handshake_failure #191

oaksofmamre opened this issue Oct 5, 2018 · 0 comments

Comments

@oaksofmamre
Copy link

I'm getting the following error:

{ [Error: Error running static method
com.ibm.db2.jcc.am.DisconnectNonTransientConnectionException: [jcc][t4][2030][11211][4.22.29] 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
	at com.ibm.db2.jcc.am.ld.a(ld.java:338)
	at com.ibm.db2.jcc.t4.a.a(a.java:572)
	at com.ibm.db2.jcc.t4.a.a(a.java:556)
	at com.ibm.db2.jcc.t4.a.a(a.java:551)
	at com.ibm.db2.jcc.t4.a.b(a.java:1648)
	at com.ibm.db2.jcc.t4.a.a(a.java:1683)
	at com.ibm.db2.jcc.t4.a.h(a.java:498)
	at com.ibm.db2.jcc.t4.a.flush_(a.java:415)
	at com.ibm.db2.jcc.am.Agent.flowOutsideUOW(Agent.java:263)
	at com.ibm.db2.jcc.t4.b.b(b.java:1256)
	at com.ibm.db2.jcc.t4.b.b(b.java:814)
	at com.ibm.db2.jcc.t4.b.a(b.java:785)
	at com.ibm.db2.jcc.t4.b.a(b.java:430)
	at com.ibm.db2.jcc.t4.b.a(b.java:403)
	at com.ibm.db2.jcc.t4.b.<init>(b.java:341)
	at com.ibm.db2.jcc.DB2SimpleDataSource.getConnection(DB2SimpleDataSource.java:234)
	at com.ibm.db2.jcc.DB2SimpleDataSource.getConnection(DB2SimpleDataSource.java:200)
	at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:472)
	at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:113)
	at java.sql.DriverManager.getConnection(DriverManager.java:571)
	at java.sql.DriverManager.getConnection(DriverManager.java:187)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
	at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
	at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
	at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1979)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1086)
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1332)
	at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:709)
	at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:122)
	at com.ibm.db2.jcc.t4.eb.b(eb.java:1737)
	at com.ibm.db2.jcc.t4.eb.a(eb.java:1685)
	at com.ibm.db2.jcc.t4.a.h(a.java:483)
	... 18 more
]
  cause:
   nodeJava_com_ibm_db2_jcc_am_DisconnectNonTransientConnectionException {} }

I've tried using relative and absolute paths but still getting above error:

require("dotenv").config();
var JDBC = require("jdbc");
var jinst = require("jdbc/lib/jinst");

if (!jinst.isJvmCreated()) {
  jinst.addOption("-Xrs");
  jinst.setupClasspath(["/Applications/dsdriver/java/db2jcc4.jar"]);
}

var config = {
  url:
    "jdbc:db2://zzz.zzz.zzz.zzz:52000/BIGSQL:sslConnection=true;sslTrustStoreLocation=/Applications/dsdriver/java/ibmtruststore.jks;sslTrustStorePassword=zzz;”,
  drivername: "com.ibm.db2.jcc.DB2Driver",
  minpoolsize: 5,
  maxpoolsize: 10,
  user: process.env.DB_USER,
  password: process.env.DB_PASS
};

var hsqldb = new JDBC(config);

hsqldb.initialize(function(err) {
  if (err) {
    console.log(err);
  }
});

Used by Java 1.7 and 1.8. Note that I can connect via DBeaver as well as a simple java program using the same JDBC url.

Thanks in advanced or your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant