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

jTDS/MSSQL/SSL #15

Open
xvfaithvx opened this issue Dec 26, 2019 · 1 comment
Open

jTDS/MSSQL/SSL #15

xvfaithvx opened this issue Dec 26, 2019 · 1 comment

Comments

@xvfaithvx
Copy link

I am relatively sure this 'issue' is my lack of understanding but hope the community may be able to help. I've clicked/read/tried every existing link on the topic without success. I have tried using different versions of jTDS though right now I'm trying with 1.3.3. Thank you in advance for any help you can provide!!

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:

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

Now I want to enable SSL. I made the change on the MSSQL server parameter and I am able to connect using Management Studio and .NET apps. However, I have not been able to connect via my Android app using jtds. Initially the only change I am making is to add ssl=require to the connection string.

Based on some different threads I've read I have 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.

"Network error IOException: SSL handshak_e 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

@morimoriysmoon
Copy link

@xvfaithvx
I think cipher/CA Certs on your Android platform is too old to support SSL connetion to MS SQL Server.

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

2 participants