microsoft / SQLServerPSModule

This repo is the home of SQL Server PowerShell Module development.
MIT License
51 stars 1 forks source link

Upgrade to v22.0.59: "SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted" #35

Closed epernst closed 1 year ago

epernst commented 1 year ago

After the upgrade to v22.0.59 our scripts using Invoke-SQLCmd fails with: "SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted".

I assume this is related to this point from the release notes:

Is there a way to disable this new default setting?

Matteo-T commented 1 year ago

Hi @epernst

If you trust the (most likely) self-signed certificate, you need to update your script to use -TrustServerCertificate.

epernst commented 1 year ago

Is -TrustServerCertificate a new parameter for Invoke-SQLCmd? I doesn't seem to be in the documentation: https://learn.microsoft.com/en-us/powershell/module/sqlserver/invoke-sqlcmd?view=sqlserver-ps

Matteo-T commented 1 year ago

Is -TrustServerCertificate a new parameter for Invoke-SQLCmd? I doesn't seem to be in the documentation: https://learn.microsoft.com/en-us/powershell/module/sqlserver/invoke-sqlcmd?view=sqlserver-ps

You are correct. The online documentation is lagging behind (by a few hours): it should be fixed in a few hours [the changes are in the staging repo and are ready to merge].

In the meanwhile, you should see it in the offline documentation (Get-Help Invoke-Sqlcmd).