PxPlus User Forum

Twitter Twitter Twitter

Author Topic: SSL connection to MySQL  (Read 1130 times)

Thomas Bock

  • Diamond Member
  • *****
  • Posts: 177
    • View Profile
SSL connection to MySQL
« on: July 06, 2021, 09:17:42 AM »
Is it possible to build a SSL connection to a MySQL-Server?
How to do it with the OPEN directive?

Devon Austen

  • Administrator
  • Diamond Member
  • *****
  • Posts: 382
  • Don’t Panic
    • View Profile
    • PVX Plus Technologies
Re: SSL connection to MySQL
« Reply #1 on: July 06, 2021, 09:43:40 AM »
To connect to a MySQL server from PxPlus you have two options.

One is to use the native MySQL interface: https://manual.pvxplus.com/?command_tags/mysql.htm

The other is to use a MySQL ODBC driver and the ODB interface: https://manual.pvxplus.com/?command_tags/odb.htm

For the native interface you will need to download and install the mysql c client and make sure the dll is in the system path so PxPlus can see it.

For the ODBC driver you will need to download and install the odbc driver and setup a DSN.

I believe both interfaces support secure SSL/TLS connections as the default if the server is setup for it.
Principal Software Engineer for PVX Plus Technologies LTD.

Mike King

  • Diamond Member
  • *****
  • Posts: 3810
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: SSL connection to MySQL
« Reply #2 on: July 06, 2021, 09:47:56 AM »
You might want to review the following web site on how to configure MySql itself to use SSL.

https://dev.mysql.com/doc/refman/8.0/en/using-encrypted-connections.html
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Thomas Bock

  • Diamond Member
  • *****
  • Posts: 177
    • View Profile
Re: SSL connection to MySQL
« Reply #3 on: July 07, 2021, 04:03:23 AM »
Let me rephrase the question.
Using [MYSQL], how can I pass the certificates to the OPEN command?

Devon Austen

  • Administrator
  • Diamond Member
  • *****
  • Posts: 382
  • Don’t Panic
    • View Profile
    • PVX Plus Technologies
Re: SSL connection to MySQL
« Reply #4 on: July 07, 2021, 08:31:05 AM »
The [MYSQL] interface does not support specifying a certificate.

It looks like the MySQL ODBC driver does have options for specifying a certificate. So I would suggest using the ODBC driver and creating a DSN with your SSL certificate set and the [ODB] interface to connect using that DSN.

Often when making a SSL/TLS connection only the server needs to specify a certificate and the client just validates it. I believe for MySQL it is the same and you can connect to a SSL/TLS secured MySQL using [MySQL] without specifying a certificate (with default MySQL server settings). So it is possible you don't need to worry about specifying the certificate. Of course your MySQL server may be setup to require it and if that is the case then you will want to use the ODBC driver so you can specify those options.
Principal Software Engineer for PVX Plus Technologies LTD.