• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

SSL/MSSQL

xvfaithvx

Lurker
It seems that everyone on the internet has had this issue or something similar, but for all of that I haven't been able to find a functioning answer/solution for the problem. I am hoping someone here has solved this and can relay that solution to me.

I have an Android app that connects to a SQL DB hosted on Amazon RDS. Without using SSL it works great; no problems. Below is the connection string:

<code>
Class.forName("net.sourceforge.jtds.jdbc.Driver").newInstance();
String connectionstring = "jdbc:jtds:sqlserver://" + servername + "/" + dbname + ";" +
"user=" + userid + ";password=" + pwd + ";";
</code>

Now I want to enable SSL. I made the change on the MSSQL server parameter and I am able to connect using SQL Management Studio and .NET apps. However, I have not been able to connect via my Android app using JTDS (1.3.3). Initially the only change I made was to add ssl=require to the connection string.I have also tried "required" vs "require" because I've seen both variations in examples.

Based on some different threads I've read I have also tried adding the following line to the gradle.properties file of the project with no change:

org.gradle.jvmargs=-Djsse.enableCBCProtection=false

No matter what I do I get the same error (below).

"Network error IOException: SSL handshake aborted: ssl=0xa67a6cc0: I/O error during system call, Broken pipe"_

This is what the stacktrace prints:

W/System.err: java.sql.SQLException: Network error IOException: SSL handshake aborted: ssl=0xa67bdcc0: I/O error during system call, Broken pipe
at net.sourceforge.jtds.jdbc.JtdsConnection.(JtdsConnection.java:437)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184)
at java.sql.DriverManager.getConnection(DriverManager.java:569)
at java.sql.DriverManager.getConnection(DriverManager.java:237)
W/System.err: at com.bluestarsolutions.caylix_time.DBRemote.openConnection(DBRemote.java:412)
at com.bluestarsolutions.caylix_time.DBRemote.DownloadInfo(DBRemote.java:47)
at com.bluestarsolutions.caylix_time.MainActivity$6.run(MainActivity.java:585)
at java.lang.Thread.run(Thread.java:764)
Caused by: javax.net.ssl.SSLHandshakeException: SSL handshake aborted: ssl=0xa67bdcc0: I/O error during system call, Broken pipe
W/System.err: at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:351)
at net.sourceforge.jtds.ssl.SocketFactories$TdsTlsSocketFactory.createSocket(SocketFactories.java:101)
at net.sourceforge.jtds.jdbc.SharedSocket.enableEncryption(SharedSocket.java:330)
at net.sourceforge.jtds.jdbc.TdsCore.negotiateSSL(TdsCore.java:577)
W/System.err: at net.sourceforge.jtds.jdbc.JtdsConnection.(JtdsConnection.java:365)
... 7 more
 
Back
Top Bottom