Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,294,801
Community Members
 
Community Events
165
Community Groups

SSL-Warning filling catalina.out when connecting to MySQL Database, useSSL not working

Hi,

my logfile logs/catalina.out is filled with the following message:

WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

 

I have tried the things below, but cannot get rid of this warning filling my logfile continuously.

In conf/server.xml I tried the following connection-strings:

*) when set up confluence-mysql-user for using plaintext-connections: (GRANT ... REQUIRE NONE)

url="jdbc:mysql://localhost:3306/confluence?useUnicode=true;characterEncoding=utf8;useSSL=false"

url="jdbc:mysql://localhost:3306/confluence?useSSL=false"

*) when set up confluence-mysql-user for using ssl-connections: (GRANT ... REQUIRE SSL)

url="jdbc:mysql://localhost:3306/confluence?useUnicode=true;characterEncoding=utf8;verifyServerCertificate=false;useSSL=true;requireSSL"

and in addition I added the mysql-ca-public-key-file to the truststore jre/lib/security/cacerts;
for info, connecting in bash-commandline with the mysql-ca-public-key-file works fine:
mysql -u confluence -p --ssl-ca=/etc/mysql/certs/ca.pem

*) I tried to also use & instead of only ; in the connection-String, same results.

It seems that the useSSL in the connection-string has no effect, the warning is always logged.

I found this MySQL-Connector-Bug:
https://bugs.mysql.com/bug.php?id=80198

but according to this using useSSL=true should not log the warning, however the warning is always logged.

My Setup:
Confluence 5.10.1
mysql  Ver 14.14 Distrib 5.7.16, for Linux (x86_64)
mysql-connector-java-5.1.40 (also tried 5.1.39)
Ubuntu 16.04 LTS Server

Thanks for help.

3 answers

I noticed that I have to edit <CONFLUENCE-DATA-DIR>/confluence.cfg.xml to set the connection-String and not <CONFLUENCE-DIR>/conf/server.xml

Problem solved, useSSL is working when setting the connection-String in confluence.cfg.xml

Hi Walter,

Can you reply with the exact string please. I have tried the below and I still still receive these errors:

<property name="hibernate.connection.url">jdbc:mysql://localhost/confluence?sessionVariables=default_storage_engine%3DInnoDB&useSSL=false&amp;</property>

<property name="hibernate.connection.url">jdbc:mysql://localhost/confluence?sessionVariables=default_storage_engine%3DInnoDB?useSSL=false</property>

Both done in <CONFLUENCE-DATA-DIR>/confluence.cfg.xml

I have this:

<property name="hibernate.connection.url">jdbc:mysql://10.10.10.10/confluence?autoReconnect=true&amp;amp;sessionVariables=storage_engine%3DInnoDB&amp;amp;useUnicode=true&amp;amp;characterEncoding=utf8</property>

which doesn't work, ha!

<property name="hibernate.connection.url">jdbc:mysql://10.10.10.10/confluence?useSSL=false</property>

seems to have silenced it ....

Hello team! Still have the same issue. In the catalina.out logs have 

Tue Mar 22 10:50:26 UTC 2022 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

nevertheless in dbconfig.xml I have the next configuration:

<url>jdbc:mysql://10.180.4.208/jiradb?useUnicode=true&amp;useSSL=false&amp;characterEncoding=UTF8&amp;sessionVariables=default_storage_engine=InnoDB</url>

I got it to work by adding skip_ssl to mysqld.conf and setting my dbconfig.xml to:

jdbc:mysql://address=(protocol=tcp)(host=localhost)(port=3306)/jira?allowPublicKeyRetrieval=true

jdbc:mysql://localhost/confluence?allowPublicKeyRetrieval=true

I wrote a JDBC Test Program:

public static final String MYSQL_URL_1 = "jdbc:mysql://localhost:3306/confluence?" +
                "useUnicode=true&amp;" +
                "characterEncoding=utf8&amp;" +
                "verifyServerCertificate=false&amp;" +
                "useSSL=true&amp;" +
                "requireSSL";

public static final String MYSQL_URL_2 = "jdbc:mysql://localhost:3306/confluence?" +
                "useSSL=false&amp;" +
                "useUnicode=true&amp;" +
                "characterEncoding=utf8";

public static final String MYSQL_URL_3 = "jdbc:mysql://localhost:3306/confluence?" +
                "useUnicode=true&amp;" +
                "characterEncoding=utf8";

public static void main(...)
{
	Connection connection = DriverManager.getConnection(MYSQL_URL_1/2/3, MYSQL_USER, MYSQL_PW);
}
MYSQL_URL_1 and MYSQL_URL_2 work
MYSQL_URL_3 creates the warning!

So it seems that Confluence or Tomcat do not parse the connection-String correctly. It seems that Confluence or Tomcat do not forward the useSSL parameter to JDBC!

Feedback on that welcome!

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

Confluence: Where work and wellness meet

Feeling overwhelmed by the demands of work and life? With a 25% increase in the prevalence of anxiety and depression worldwide during the pandemic, for most of us, it’s a resounding yes . 🙋‍♀️ ...

827 views 10 23
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you