Reputation: 593
Can somebody please let me know what's missing? All %env% variables are correct. Everything worked perfectly until I enabled SSL.
Using these connection details and 'Key.crt.pem' I have no issues connecting to the database using Sequel Pro.
Error:
{"code":500,"message":"An exception occurred in driver: SQLSTATE[HY000] [9002] SSL connection is required. Please specify SSL options and retry."}
doctrine:
dbal:
# configure these for your database server
driver: 'pdo_mysql'
server_version: '5.7'
charset: latin1
default_table_options:
charset: latin1
collate: latin1_swedish_ci
dbname: '%env(resolve:DATABASE_NAME)%'
host: '%env(resolve:DATABASE_HOST)%'
port: '%env(resolve:DATABASE_PORT)%'
user: '%env(resolve:DATABASE_USER)%@%env(resolve:DATABASE_HOST)%'
password: '%env(resolve:DATABASE_PASSWORD)%'
mapping_types:
enum: string
options:
MYSQL_ATTR_SSL_CA : '/Path/Key.crt.pem'
Upvotes: 2
Views: 1707
Reputation: 413
To answer @sanjok Gurung
From symfony 3.2, you can use php constants in yaml files. In this example, it would give:
options:
!php/const:PDO::MYSQL_ATTR_SSL_CA: : '/Path/Key.crt.pem'"
Ref: https://symfony.com/blog/new-in-symfony-3-2-php-constants-in-yaml-files
Upvotes: 3