Skip to content

Update SqlsrvDriver.php#281

Merged
rdeutz merged 1 commit intojoomla-framework:2.0-devfrom
Kenneth202212:SqlSvr-Trust-Cert-Fix
Aug 15, 2024
Merged

Update SqlsrvDriver.php#281
rdeutz merged 1 commit intojoomla-framework:2.0-devfrom
Kenneth202212:SqlSvr-Trust-Cert-Fix

Conversation

@Kenneth202212
Copy link
Contributor

Summary of Changes

MS Changed their most recent SQLServer component for PHP to fail on SQL's default self-signed certificate unless you say TrustServerCertificate true. Unfortunately there is no current means to pass that value through the Joomla framework

Testing Instructions

`

$option = array();
$option['driver']   = 'sqlsrv';
$option['host']     = '(host)';
$option['user']     = '(user)'; 
$option['password'] = '(pass) ';
$option['database'] = '(db-name)';
$option['trust_certificate'] = true;

$db = (new Joomla\Database\DatabaseFactory)->getDriver('sqlsrv', $option);

$db->setQuery('SELECT COUNT(*) FROM MyTable');
echo 'Results: ' . (int) $db->loadResult();`

Documentation Changes Required

Handle change in recent SqlSvr extensions which defaults trust to false. SQLServer self-signed certificates won't pass so the connection will fail without this parameter
@rdeutz rdeutz merged commit 4bbb88b into joomla-framework:2.0-dev Aug 15, 2024
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

Successfully merging this pull request may close these issues.

3 participants