Package: sqlline
Version: 1.0.2-4


Running the sqlline binary against a MS SQL Server JDBC data source results in 
the following error:

$ sqlline
sqlline version 1.0.2 by Marc Prud'hommeaux
sqlline>  !connect jdbc:sqlserver://X.X.X.X:1433;databaseName=MyDatabase
Connecting to jdbc:sqlserver://X.X.X.X:1433;databaseName=MyDatabase
Enter username for jdbc:sqlserver://X.X.X.X:1433;databaseName=MyDatabase: foo
Enter password for jdbc:sqlserver://X.X.X.X:1433;databaseName=MyDatabase: ***
Apr 17, 2013 7:34:46 PM enableSSL
INFO: path: 
Security providers: [SUN version 1.6, SunRsaSign version 1.7, SunJSSE version 
1.6, SunJGSS version 1.0, SunSASL version 1.5, XMLDSig version 1.0, SunPCSC 
version 1.6]
SSLContext provider info: Sun JSSE provider(PKCS12, SunX509 key/trust 
factories, SSLv3, TLSv1)
SSLContext provider services:
[SunJSSE: KeyFactory.RSA ->
  aliases: [1.2.840.113549.1.1, OID.1.2.840.113549.1.1]
, SunJSSE: KeyPairGenerator.RSA ->
  aliases: [1.2.840.113549.1.1, OID.1.2.840.113549.1.1]
, SunJSSE: Signature.MD2withRSA ->$MD2withRSA
  aliases: [1.2.840.113549.1.1.2, OID.1.2.840.113549.1.1.2]
, SunJSSE: Signature.MD5withRSA ->$MD5withRSA
  aliases: [1.2.840.113549.1.1.4, OID.1.2.840.113549.1.1.4]
, SunJSSE: Signature.SHA1withRSA ->$SHA1withRSA
  aliases: [1.2.840.113549.1.1.5, OID.1.2.840.113549.1.1.5,, 
, SunJSSE: Signature.MD5andSHA1withRSA ->
, SunJSSE: KeyManagerFactory.SunX509 ->$SunX509
, SunJSSE: KeyManagerFactory.NewSunX509 ->$X509
, SunJSSE: TrustManagerFactory.SunX509 ->$SimpleFactory
, SunJSSE: TrustManagerFactory.PKIX ->$PKIXFactory
  aliases: [SunPKIX, X509, X.509]
, SunJSSE: SSLContext.SSL ->
, SunJSSE: SSLContext.SSLv3 ->
, SunJSSE: SSLContext.TLS ->
, SunJSSE: SSLContext.TLSv1 ->
, SunJSSE: SSLContext.Default ->
, SunJSSE: KeyStore.PKCS12 ->
java.ext.dirs: /usr/share/java/:/usr/local/share/java/
Error: The driver could not establish a secure connection to SQL Server by 
using Secure Sockets Layer (SSL) encryption. Error: "RSA premaster secret 
error". ClientConnectionId:656fc562-608b-4bb4-9bf1-29720f312884 

According to other bug reports with similar errors, it's because java.ext.dirs 
overrides the automatic use of the jre/lib/ext directory (reference And indeed, 
manually updating the sqlline binary to add the correct ext dir does fix this 
for the above test. Here's my local patch, though there's probably a much 
better way to do this when java-wrappers is involved.


--- /usr/bin/sqlline    2009-07-13 15:08:44.000000000 -0400
+++ sqlline     2013-04-17 19:40:06.000000000 -0400
@@ -1,6 +1,7 @@


 # Include the wrappers utility script
 . /usr/lib/java-wrappers/
@@ -11,6 +12,18 @@
 # Define our classpath
 find_jars jline sqlline

+# find jre/lib/ext
+if [ ! -d $EXT ] ; then
+  EXT=$JAVA_HOME/jre/lib/ext
+  if [ ! -d $EXT ] ; then
+    echo "Can't find extension dir (jre/lib/ext)!" >&2
+    exit 1
+  fi
 # Run SQLLine
 run_java sqlline.SqlLine $extra_args "$@"
The information transmitted, including any content in this communication is 
confidential, is intended only for the use of the intended recipient and is the 
property of The Western Union Company or its affiliates and subsidiaries. If 
you are not the intended recipient, you are hereby notified that any use of the 
information contained in or transmitted with the communication or 
dissemination, distribution, or copying of this communication is strictly 
prohibited. If you have received this communication in error, please notify the 
Western Union sender immediately by replying to this message and delete the 
original message

This is the maintainer address of Debian's Java team
Please use for discussions and questions.

Reply via email to