gpt4 book ai didi

php - SSL 加密 ZF2 PDO 连接到 Mysql

转载 作者:太空宇宙 更新时间:2023-11-03 13:54:38 25 4
gpt4 key购买 nike

是否可以通过 ZF2 与我的 MySql 服务器建立 SSL 加密连接?如果是,那怎么可能?我在网上找不到任何关于 ZF2 PDO SSL 连接的信息。

最佳答案

return array(
'db' => array(
'adapters' => array(
// The first (default) database connection
'zf2' => array(
'driver' => 'pdo',
'dsn' => 'mysql:dbname=zf2;host=sandbox-db-vm',
'username' => 'root',
'password' => 'password',
),
// Now the second database connection
'zf2ssl' => array(
'driver' => 'pdo',
'dsn' => 'mysql:dbname=zf2;host=sandbox-db-vm',
'username' => 'ssl_user',
'password' => 'ssl_test',
PDO::MYSQL_ATTR_SSL_KEY => '/etc/mysql-ssl/client-key.pem',
PDO::MYSQL_ATTR_SSL_CERT => '/etc/mysql-ssl/client-cert.pem',
PDO::MYSQL_ATTR_SSL_CA => '/etc/mysql-ssl/ca-cert.pem'
),
),
),
'service_manager' => array(
// Let's make sure our adapters get instantiated
'abstract_factories' => array(
'Zend\Db\Adapter\AdapterAbstractServiceFactory',
),
),
);

关于php - SSL 加密 ZF2 PDO 连接到 Mysql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23386211/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com