I\'d like to add my SSL cert and key files to Doctrine DBAL configuration but I don\'t see how to achieve that.
In PHP, I just have to write something like :
<
I found a much easier way than the rest.
Make the following settings in app/config/config.yml
:
# Doctrine Configuration
doctrine:
dbal:
driver: pdo_mysql
host: "%database_host%"
port: "%database_port%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
charset: UTF8
# Options for SSL connection
options:
MYSQL_ATTR_SSL_CA : %ca_cert%
MYSQL_ATTR_SSL_KEY : %private_key%
MYSQL_ATTR_SSL_CERT : %public_cert%
Then in your app/config/parameters.yml
file:
parameters:
...
# SSL Info
private_key: /etc/my.cnf.d/certs/client-key.pem
public_cert: /etc/my.cnf.d/certs/client-cert.pem
ca_cert: /etc/my.cnf.d/certs/ca-cert.pem
I tested this on Symfony3 and this works great. The paths above may be different, in particular the certs may be different depending on your distro and how you set it up.