How to Successfully Connect to SQL Server Database Using SSL
Asked by Loyd Wheeler:

I am running Confluence 5.5.6 standalone version. It appears that the Confluence application performs some select statements that return 'variant' data typed columns and SQL Server supports 'variant' data types. The issue appears to be the JDBC client that is delivered with the Confluence application does not support 'variant' data types.

When I start the application, our Database Admin sees a good encrypted connection on the database (keep in mind we normally have much more than one connection), but the application never comes up.

This is the entry that I have in the confluence.cfg.xml file...

\<property name="hibernate.connection.url"\>jdbc:jtds:sqlserver://servername:1234/databasename;ssl=require\</property\>

Keep in mind that we are not interested in changing the application's Java code. We are trying to achieve this using configuration, unless there is no other way to resolve the issue.

Thanks,

Loyd


Answers:
author: rrudnicki
body: Hi Loyd,

Could you try the configuration below and let us know if this work?

```
&lt;property name="hibernate.connection.url"&gt;jdbc:jtds:sqlserver://servername:1234/databasename;verifyServerCertificate=false;useSSL=true;requireSSL&lt;/property&gt;
```

Regards,

Renato Rudnicki


author: lavitz slambert
body: Hey Loyd,

To force confluence to connect on a sql server using the enforce encryption option you need to use ssl=true on the connection string and disable the JAVA cbc protection as you can see in below KB:

<https://confluence.atlassian.com/display/CONFKB/Cannot+Connect+Confluence+to+MS+SQL+Server+Using+Force+Encryption>  
Hope it helps,  
Lavitz - the guy that uses Confluence on Windows as a Hobby!


author: Mallmann
body: Hello Loyd,

Can you share what appears on your logs when you try to start the instance using a secure connection with the database?

Eduardo


author: Loyd Wheeler
body: This is the only thing that I get in the atlassian-confluence.log (see below). Only the first three lines and then nothing else.

2015-04-29 15:56:44,374 INFO \[localhost-startStop-1\] \[com.atlassian.confluence.lifecycle\] contextInitialized Starting Confluence 5.5.6 \[build 5527 based on commit hash d6c318572c182872608bdc1754f542eab16839cb\] 2015-04-29 15:56:46,340 INFO \[localhost-startStop-1\] \[springframework.web.context.ContextLoader\] initWebApplicationContext Root WebApplicationContext: initialization started 2015-04-29 15:56:48,895 INFO \[localhost-startStop-1\] \[com.atlassian.confluence.lifecycle\] \<init\> Loading EhCache cache manager

Here is what I get in the catalina.out log (see below). The entry at the bottom with a timestamp of 16:06:15 is when I forcibly stop the instance from trying to come up.

Apr 29, 2015 3:56:33 PM org.apache.tomcat.util.digester.SetPropertiesRule begin WARNING: \[SetPropertiesRule\]{Server} Setting property 'debug' to '0' did not find a matching property. Apr 29, 2015 3:56:33 PM org.apache.catalina.startup.SetAllPropertiesRule begin WARNING: \[SetAllPropertiesRule\]{Server/Service/Connector} Setting property 'debug' to '0' did not find a matching property. Apr 29, 2015 3:56:33 PM org.apache.tomcat.util.digester.SetPropertiesRule begin WARNING: \[SetPropertiesRule\]{Server/Service/Engine} Setting property 'debug' to '0' did not find a matching property. Apr 29, 2015 3:56:33 PM org.apache.tomcat.util.digester.SetPropertiesRule begin WARNING: \[SetPropertiesRule\]{Server/Service/Engine/Host} Setting property 'debug' to '0' did not find a matching property. Apr 29, 2015 3:56:33 PM org.apache.tomcat.util.digester.SetPropertiesRule begin WARNING: \[SetPropertiesRule\]{Server/Service/Engine/Host/Context} Setting property 'debug' to '0' did not find a matching property. Apr 29, 2015 3:56:33 PM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler \["http-bio-8090"\] Apr 29, 2015 3:56:33 PM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler \["http-bio-8443"\] Apr 29, 2015 3:56:34 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 856 ms Apr 29, 2015 3:56:34 PM org.apache.catalina.core.StandardService startInternal INFO: Starting service Tomcat-Standalone Apr 29, 2015 3:56:34 PM org.apache.catalina.core.StandardEngine startInternal INFO: Starting Servlet Engine: Apache Tomcat/7.0.47 2015-04-29 15:56:44,374 INFO \[localhost-startStop-1\] \[com.atlassian.confluence.lifecycle\] contextInitialized Starting Confluence 5.5.6 \[build 5527 based on commit hash d6c318572c182872608bdc1754f542eab16839cb\]

2015-04-29 16:06:15 Full thread dump Java HotSpot(TM) 64-Bit Server VM (23.21-b01 mixed mode):

"com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2" daemon prio=10 tid=0x00007f6f1cd7a800 nid=0x5c69 in Object.wait() \[0x00007f6f677aa000\] java.lang.Thread.State: TIMED_WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on \<0x00000007d76c8660\> (a com.mchange.v2.async.ThreadPoolAsynchronousRunner) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:534) - locked \<0x00000007d76c8660\> (a com.mchange.v2.async.ThreadPoolAsynchronousRunner)


author: Loyd Wheeler
body: Just to clarify, the SQL Server database is SQL Server 2008 R2.


Tags: confluence-administration