Skip to content

How to add MYSQL_ATTR_SSL_CA option? #296

@duje13

Description

@duje13

Hi,

Usually database platforms (such as PlanetScale or TiDB Cloud) do not allow to connect without SSL/TLS. So, to be able to connect I need to set PDO::MYSQL_ATTR_SSL_CA attribute. My application is Symfony, so I do it on Symfony way by setting it in doctrine.yaml config file. But I don't know how to do it for TNT?

This is how I setup TNT currently:

//$dbUrl is env variable, DATABASE_URL="mysql://user:password@host:port/db_name"
$this->dbUrl = parse_url($dbUrl);
$tntConfig = [
            "driver" => $dbUrl["scheme"],
            "host" => $dbUrl["host"] . ":" . $dbUrl["port"],
            "database" => substr($dbUrl["path"], 1),
            "username" => $dbUrl["user"],
            "password" => $dbUrl["pass"],
            "storage" => "my/tnt/output/path,
            "stemmer" => PorterStemmer::class, 
];

$this->tntObject = new TNTSearch();
$this->tntObject->loadConfig($tntConfig);

Can I somehow add additional options (MYSQL_ATTR_SSL_CA in my case) to config? Or is there any other way to make TNT be able to connect to MySQL using SSL/TLS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions