Could you try adding 'trust_server_certificate' => true to your sqlsrv config in database.php?
SQL Server self-signed certificate after Valet restart
This is quite a ways beyond my knowledge of database drivers and schemes, so I thought I’d better ask here.
I’m developing a project on my localhost using Valet on macOS 10.15.7; PHP and other things are installed via Homebrew. I connect to an SQL Server database on a remote production server. All this has been working well.
Just now, php-fpm starting hogging a lot of CPU and making my fans go crazy. A quick Google search indicated this was a Valet issue, so I did a valet restart – that did indeed fix the CPU issue.
After restarting Valet, though, any page in my Laravel app that I visit gives me the following error:
// Illuminate\Database\QueryException
SQLSTATE[08001]: [Microsoft][ODBC Driver 18 for SQL Server]SSL Provider: [error:16000069:STORE routines::unregistered scheme:scheme=file][error:80000002:system library::No such file or directory:calling stat(/usr/local/etc/openssl@3/certs)][error:16000069:STORE routines::unregistered scheme:scheme=file]
When I look in /usr/local/etc/openssl@3/, there is indeed no certs folder, while there is an empty folder with this name inside /usr/local/etc/[email protected]/. If I add the folder manually, I get this error instead:
// Illuminate \ Database \ QueryException
SQLSTATE[08001]: [Microsoft][ODBC Driver 18 for SQL Server]SSL Provider: [error:0A000086:SSL routines::certificate verify failed:self-signed certificate]
So apparently I’m now using a self-signed certificate to connect, and that’s a problem? Or the remote server is using a self-signed certificate for the database connection (though I don’t think it is), and that’s a problem? I can still connect through Azure Data Studio, so I would presume it’s the local certificate used by PHP that’s the issue, not the remote server’s (which hasn’t changed, anyway).
In order to test a different issue, I recently manually installed the sqlsrv and pdo_sqlsrv drivers on my Mac, and doing so also auto-updated a whole bunch of other stuff in Homebrew. I suspect that has something to do with the current error, but I have no idea what or why.
Indeed, I don’t know whether this is a Laravel/Valet issue, or a Homebrew/PHP issue … or a something-else-entirely issue.
Can anyone help me figure out what’s going on here, and how I can fix it?
Please or to participate in this conversation.