3

I would like to have my jdbc connection used in the application using Jersey and Tomcat to be secured using SSL. The mySQL server already supports SSL, I have the necessary SSL certificate file present on the computer running NetBeans and I can connect to the mySQL server using SSL from MySQL Workbench.

The definition for an unsecured connection currently looks like:

<Resource name="jdbc/Colabo" auth="Container" type="javax.sql.DataSource"
           maxActive="100" maxIdle="30" maxWait="10000"
           username="xxxx" password="yyyyy" driverClassName="com.mysql.jdbc.Driver"
           url="jdbc:mysql://ip.address:3306/db?autoReconnect=true"/>

How can I specify in the section of the context.cml file the connection should be done using SSL?

4

2 に答える 2

5

同様の質問への回答に触発されました- ssl を介して mysql に接続するように spring を構成します

SSL 設定は URL で渡すことができます。

url="jdbc:mysql://ip.address:3306/db?autoReconnect=true&amp;verifyServerCertificate=false&amp;useSSL=true&amp;requireSSL=true"/

オプションを機能させる方法が見つかりませんでしたverifyServerCertificate=true。おそらく、CA 証明書の場所を指定する必要があります。そのための設定です。

于 2013-05-15T08:56:21.280 に答える