laravel-data-anonymization
laravel-data-anonymization copied to clipboard
Remote database with secure connection by certificate
SQLSTATE[HY000] [3159] Connections using insecure transport are prohibited while --require_secure_transport=ON.
The website is functioning alright, PHP-CLI also works fine, and tested the connection to DB with the tinker.
Found and fixed it within the Database/SqlDatabase.php
/**
* Constructor.
*
* @param string $dsn
* @param string $user
* @param string $password
* @param null|array $options
*/
public function __construct($dsn, $user, $password, $options = null)
{
if (is_null($options)) {
$options = [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::MYSQL_ATTR_SSL_CA => 'some/ridiculous/filepath', // this is the really dirty fix, because the certificate will not be checked
PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => false // this is the really dirty fix, because the certificate will not be checked
];
}
$this->pdo = new PDO($dsn, $user, $password, $options);
}
Too lazy to create a PR, sorry. Also seems this repo is dead.