Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem in SSL connection through PDO #12

Open
skverma618 opened this issue Jul 29, 2023 · 0 comments
Open

Problem in SSL connection through PDO #12

skverma618 opened this issue Jul 29, 2023 · 0 comments

Comments

@skverma618
Copy link

I tried connecting my local codebase with the remote database through PDO but its not working, after that I made some changes in core.php and created a function using mysqli, and now the connection is working.

I used the same connection variables and pem files for verification

inside connect function in core.php

I also tried directly writing the PDO code as follows:

           $clientCertPath = $_SERVER['DOCUMENT_ROOT'] . "/client-cert.pem";
            $clientKeyPath = $_SERVER['DOCUMENT_ROOT'] . "/client-key.pem";
            $caCertPath = $_SERVER['DOCUMENT_ROOT'] . "/server-ca.pem";

            // PDO Connection options for SSL
            $pdoOptions = array(
                \PDO::MYSQL_ATTR_SSL_CA => $caCertPath,
                \PDO::MYSQL_ATTR_SSL_KEY => $clientKeyPath,
                \PDO::MYSQL_ATTR_SSL_CERT => $clientCertPath,
                \PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => false,
            );
@mychidarko mychidarko transferred this issue from leafsphp/docs Oct 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant