Reputation: 467
I have a web app using a mysql database as its data store. It is currently running in Glassfish and talking to that mysql database with SSL.
I am thinking about migrating to Wildfly but I can't seem to create a Wildfly datasource that will talk to the mysql database with SSL enabled.
The Wildfly server is running in standalone mode. What config or option do I need to add that will allow Wildfly to talk to the mysql database with ssl?
Upvotes: 2
Views: 3025
Reputation: 6887
You will need to add the certificate to keystore to make an SSL connection.You can refer to the following links.
Then you can create a datasource with a SSL URL as demonstrated in the below sample in standalone.xml
file.
<datasource jndi-name="java:jboss/datasources/dbname" pool-name="poolname">
<connection-url>jdbc:mysql://serveraddress:3306/dbname?ssl=true</connection-url>
<driver>mysql</driver>
<security>
<user-name>user</user-name>
<password>password</password>
</security>
</datasource>
<drivers>
<driver name="mysql" module="com.mysql">
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
</drivers>
Upvotes: 4