From 651abd1117a81db086489a06f8c8a4756c5a9b1c Mon Sep 17 00:00:00 2001 From: Louis-Arnaud Date: Thu, 26 Sep 2024 12:12:24 +0200 Subject: [PATCH 1/6] Update doctrine.rst on ssl documentation --- reference/configuration/doctrine.rst | 59 ++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/reference/configuration/doctrine.rst b/reference/configuration/doctrine.rst index c49122575a0..0657648d43d 100644 --- a/reference/configuration/doctrine.rst +++ b/reference/configuration/doctrine.rst @@ -460,5 +460,64 @@ If the ``dir`` configuration is set and the ``is_bundle`` configuration is ``true``, the DoctrineBundle will prefix the ``dir`` configuration with the path of the bundle. +SSL Connection with MySQL +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +If you want to configure a secure SSL connection to MySQL in your Symfony application using Doctrine, you need to set specific options for the SSL certificates. Here's how to configure the connection using environment variables for the certificate paths: + +.. configuration-block:: + +xml + +.. code-block:: yaml + + doctrine: + dbal: + url: '%env(DATABASE_URL)%' + server_version: '8.0.31' + driver: 'pdo_mysql' + options: + # SSL private key (PDO::MYSQL_ATTR_SSL_KEY) + 1007: '%env(MYSQL_SSL_KEY)%' + # SSL certificate (PDO::MYSQL_ATTR_SSL_CERT) + 1008: '%env(MYSQL_SSL_CERT)%' + # SSL CA authority (PDO::MYSQL_ATTR_SSL_CA) + 1009: '%env(MYSQL_SSL_CA)%' + +.. code-block:: xml + + + + + + + + %env(MYSQL_SSL_KEY)% + %env(MYSQL_SSL_CERT)% + %env(MYSQL_SSL_CA)% + + + + +Make sure that your environment variables are correctly set in your ``.env.local`` or ``.env.local.php`` file as follows: + +.. code-block:: bash + + MYSQL_SSL_KEY=/path/to/your/server-key.pem + MYSQL_SSL_CERT=/path/to/your/server-cert.pem + MYSQL_SSL_CA=/path/to/your/ca-cert.pem + +This configuration secures your MySQL connection with SSL by specifying the paths to the required certificates. + + .. _DBAL documentation: https://www.doctrine-project.org/projects/doctrine-dbal/en/current/reference/configuration.html .. _`Doctrine Metadata Drivers`: https://www.doctrine-project.org/projects/doctrine-orm/en/current/reference/metadata-drivers.html From 2673994fd1f58321b8a9ac5858f3554967239cf5 Mon Sep 17 00:00:00 2001 From: Louis-Arnaud Date: Thu, 26 Sep 2024 13:45:51 +0200 Subject: [PATCH 2/6] Return on linters --- reference/configuration/doctrine.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/configuration/doctrine.rst b/reference/configuration/doctrine.rst index 0657648d43d..d455c37d48d 100644 --- a/reference/configuration/doctrine.rst +++ b/reference/configuration/doctrine.rst @@ -461,7 +461,7 @@ is ``true``, the DoctrineBundle will prefix the ``dir`` configuration with the path of the bundle. SSL Connection with MySQL -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~ If you want to configure a secure SSL connection to MySQL in your Symfony application using Doctrine, you need to set specific options for the SSL certificates. Here's how to configure the connection using environment variables for the certificate paths: From 6bdc124d41cfa532437498e12ed488967cdb16a5 Mon Sep 17 00:00:00 2001 From: Louis-Arnaud Date: Thu, 26 Sep 2024 13:55:12 +0200 Subject: [PATCH 3/6] Update doctrine.rst --- reference/configuration/doctrine.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/configuration/doctrine.rst b/reference/configuration/doctrine.rst index d0d5b32ed44..d9ea8e9151e 100644 --- a/reference/configuration/doctrine.rst +++ b/reference/configuration/doctrine.rst @@ -23,7 +23,7 @@ configuration. .. _`reference-dbal-configuration`: Doctrine DBAL Configuration ---------------------------- +---------------------------- DoctrineBundle supports all parameters that default Doctrine drivers accept, converted to the XML or YAML naming standards that Symfony From 1f5c4b8759297ede46accb75842ab605a7fcfe20 Mon Sep 17 00:00:00 2001 From: Louis-Arnaud Date: Thu, 26 Sep 2024 13:57:02 +0200 Subject: [PATCH 4/6] Update doctrine.rst --- reference/configuration/doctrine.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/configuration/doctrine.rst b/reference/configuration/doctrine.rst index d9ea8e9151e..eea8ae83a8d 100644 --- a/reference/configuration/doctrine.rst +++ b/reference/configuration/doctrine.rst @@ -23,7 +23,7 @@ configuration. .. _`reference-dbal-configuration`: Doctrine DBAL Configuration ----------------------------- +--------------------------- DoctrineBundle supports all parameters that default Doctrine drivers accept, converted to the XML or YAML naming standards that Symfony @@ -467,7 +467,7 @@ is ``true``, the DoctrineBundle will prefix the ``dir`` configuration with the path of the bundle. SSL Connection with MySQL -~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~ If you want to configure a secure SSL connection to MySQL in your Symfony application using Doctrine, you need to set specific options for the SSL certificates. Here's how to configure the connection using environment variables for the certificate paths: From bf5fc8b2627f973af1aeb46ea14a92c803f21cee Mon Sep 17 00:00:00 2001 From: Louis-Arnaud Date: Thu, 26 Sep 2024 13:59:09 +0200 Subject: [PATCH 5/6] Update doctrine.rst --- reference/configuration/doctrine.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/reference/configuration/doctrine.rst b/reference/configuration/doctrine.rst index eea8ae83a8d..c095044bcf6 100644 --- a/reference/configuration/doctrine.rst +++ b/reference/configuration/doctrine.rst @@ -473,8 +473,6 @@ If you want to configure a secure SSL connection to MySQL in your Symfony applic .. configuration-block:: -xml - .. code-block:: yaml doctrine: From 7f23d8963f2f081ad4209a22b0cf9b0816cca121 Mon Sep 17 00:00:00 2001 From: Louis-Arnaud Date: Thu, 26 Sep 2024 14:01:14 +0200 Subject: [PATCH 6/6] Update doctrine.rst --- reference/configuration/doctrine.rst | 76 ++++++++++++++-------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/reference/configuration/doctrine.rst b/reference/configuration/doctrine.rst index c095044bcf6..ee16f71f76c 100644 --- a/reference/configuration/doctrine.rst +++ b/reference/configuration/doctrine.rst @@ -473,44 +473,44 @@ If you want to configure a secure SSL connection to MySQL in your Symfony applic .. configuration-block:: -.. code-block:: yaml - - doctrine: - dbal: - url: '%env(DATABASE_URL)%' - server_version: '8.0.31' - driver: 'pdo_mysql' - options: - # SSL private key (PDO::MYSQL_ATTR_SSL_KEY) - 1007: '%env(MYSQL_SSL_KEY)%' - # SSL certificate (PDO::MYSQL_ATTR_SSL_CERT) - 1008: '%env(MYSQL_SSL_CERT)%' - # SSL CA authority (PDO::MYSQL_ATTR_SSL_CA) - 1009: '%env(MYSQL_SSL_CA)%' - -.. code-block:: xml - - - - - - - - %env(MYSQL_SSL_KEY)% - %env(MYSQL_SSL_CERT)% - %env(MYSQL_SSL_CA)% - - - + .. code-block:: yaml + + doctrine: + dbal: + url: '%env(DATABASE_URL)%' + server_version: '8.0.31' + driver: 'pdo_mysql' + options: + # SSL private key (PDO::MYSQL_ATTR_SSL_KEY) + 1007: '%env(MYSQL_SSL_KEY)%' + # SSL certificate (PDO::MYSQL_ATTR_SSL_CERT) + 1008: '%env(MYSQL_SSL_CERT)%' + # SSL CA authority (PDO::MYSQL_ATTR_SSL_CA) + 1009: '%env(MYSQL_SSL_CA)%' + + .. code-block:: xml + + + + + + + + %env(MYSQL_SSL_KEY)% + %env(MYSQL_SSL_CERT)% + %env(MYSQL_SSL_CA)% + + + Make sure that your environment variables are correctly set in your ``.env.local`` or ``.env.local.php`` file as follows: