ODBC Driver 18 for SQL Server doesn’t allow PHP PDO to connect

I’m in the process of updating our pipeline due to upgrading the required PHP version. In the process I needed to change our MSSQL client to sqlcmd and I installed msodbcsql18 mssql-tools18 unixodbc-dev. With this change the SQL driver now requires a valid cert for the SQL to allow connection. With sqlcmd I just needed to add a flag to bypass this, but our automated tests against the MSSQL database aren’t allowed to connect with error:

SQLSTATE[08001]: [Microsoft][ODBC Driver 18 for SQL Server]SSL Provider: [error:0A000086:SSL routines::certificate verify failed:self-signed certificate]

I’ve being able to find the same issue for Laravel, but none that would be using PDO for the connection. I’ve tried passing the following options array to try to add the parameters to the connection that would allow it to ignore the cert validity but no success

[
    'trust_server_certificate' => true, // 'TrustServerCertificate' too
    'encrypt' => 'no', // 'Encrypt' => 'yes' as well
]

Any solutions for this?