@brandy
To connect to a database using SSL in Laravel, you can follow these steps:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
'mysql' => [ 'driver' => 'mysql', 'host' => env('DB_HOST', '127.0.0.1'), 'port' => env('DB_PORT', '3306'), 'database' => env('DB_DATABASE', 'forge'), 'username' => env('DB_USERNAME', 'forge'), 'password' => env('DB_PASSWORD', ''), 'unix_socket' => env('DB_SOCKET', ''), 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', 'prefix' => '', 'strict' => false, 'engine' => null, 'options' => [ PDO::MYSQL_ATTR_SSL_KEY => '/path_to_client_key.pem', PDO::MYSQL_ATTR_SSL_CERT => '/path_to_client_cert.pem', PDO::MYSQL_ATTR_SSL_CA => '/path_to_ca_cert.pem', ], ], |
By following these steps, you should be able to connect to a database using SSL in Laravel.