Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hibernate configuration: I have already set useSSL=false, but still got the warning

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>
        <!-- Database connection settings -->
        <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="connection.url">jdbc:mysql://localhost:3306/schedule?useSSL=false&amp;autoReconnect=true </property>
        <property name="connection.username">root</property>
        <property name="connection.password">1234</property>

        <!-- JDBC connection pool (use the built-in) -->
        <property name="connection.pool_size">1</property>

        <!-- SQL dialect -->
        <property name="dialect"
>org.hibernate.dialect.MySQLDialect</property>

        <!-- Enable Hibernate's automatic session context management -->
        <property name="current_session_context_class"
>thread</property>

        <!-- Disable the second-level cache  -->
        <property name="cache.provider_class"
>org.hibernate.cache.NoCacheProvider</property>

        <!-- Echo all executed SQL to stdout -->
        <property name="show_sql"
>true</property>

     <property name="format_sql">true</property>

     <property name="hibernate.c3p0.acquire_increment">1</property>
    <property name="hibernate.c3p0.idle_test_period">100</property>
    <property name="hibernate.c3p0.max_size">10</property>
    <property name="hibernate.c3p0.max_statements">10</property>
    <property name="hibernate.c3p0.min_size">10</property>
    <property name="hibernate.c3p0.timeout">100</property>
        <mapping resource="model/modelmap.hbm.xml"/>
    </session-factory>
</hibernate-configuration >

This is my hibernate configuration xml file, I have already set useSSL=false, but still got the warning :

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.

Can someone help me out ?

like image 937
Doris Avatar asked Oct 30 '22 01:10

Doris


1 Answers

Even I faced the same error, the issue was the sql-connector version and and MySql80 instance was not matching, as soon as I updated the connector version to 8.0.21 the problem was resolved...

like image 110
KD1234 Avatar answered Nov 15 '22 06:11

KD1234