How Connect MYSQL SSL on Lumens

   

Hai,
[1] Path vendor\laravel\lumen-framework\config\database.php

[2] Update code database.php

'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' => env('DB_CHARSET', 'utf8mb4'),
            'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
            'prefix' => env('DB_PREFIX', ''),
            'strict' => env('DB_STRICT_MODE', true),
            'engine' => env('DB_ENGINE', null),
            'timezone' => env('DB_TIMEZONE', '+00:00'),
            'options'    => array(   PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT  => false,
                                     PDO::MYSQL_ATTR_SSL_KEY  => storage_path().'/ssl/key.pem',
                                    PDO::MYSQL_ATTR_SSL_CERT => storage_path().'/ssl/cert.pem',
                                    PDO::MYSQL_ATTR_SSL_CA   => storage_path().'/ssl/ca.pem'),
        ],

[3] Copy 3 file SSL Connection to Storage Location Lumens

[4] Done

   

Wahyu Amaldi, M.Kom has written 209 articles

Hallo Pembaca,
Saya merupakan konsultan di dunia SAP dan merupakan Spesialis .Net Programming.
Saya gemar berbagi pengalaman mengenai SAP & Dunia Programming, dan jika ada sesuatu yang perlu ditanyakan, bisa hubungi saya di email berikut ini:

Email 1 : wahyu.amaldi@outlook.com
Email 2 : wahyu.amaldi@ilmuprogram.com

Semoga Artikel yang Anda baca di website ini berguna dan dapat membantu Anda dalam menemukan solusi.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>