Describe the bug
The Foundation setup.cmd script fails during database setup with SSL certificate trust errors when using ODBC Driver 18 for SQL Server or later. The sqlcmd commands cannot connect to the local SQL Server instance due to untrusted certificates.
To Reproduce
- Install SQL Server 2025 (or SQL Server 2022+, or ODBC Driver 18+ separately)
- Run setup.cmd from the Foundation repository root
- Enter application name and SQL server details when prompted
- Observe errors during "Installing foundation configuration" and "Installing unique coupon schema" steps
- Error messages:
## Installing foundation configuration ##
Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server : SSL Provider: The certificate chain was issued by an authority that is not trusted.
Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server : Client unable to establish connection.
Expected behavior
The setup script should successfully execute the SQL scripts (FoundationConfigurationSchema.sql and UniqueCouponSchema.sql) against the Commerce database without SSL certificate errors.
Desktop (please complete the following information):
OS: Windows 11 Pro
SQL Server: 2025 (Developer Edition)
ODBC Driver: 18 for SQL Server
Additional context
ODBC Driver 18 for SQL Server enforces SSL/TLS encryption by default and requires trusted server certificates. For local development environments, the -C flag needs to be added to sqlcmd commands to trust the server certificate.
Solution:
Add the -C flag to line 105 in setup.cmd:
Before:
set sql=sqlcmd -S %SQLSERVER% %ADDITIONAL_SQLCMD%
After:
set sql=sqlcmd -S %SQLSERVER% %ADDITIONAL_SQLCMD% -C
Describe the bug
The Foundation setup.cmd script fails during database setup with SSL certificate trust errors when using ODBC Driver 18 for SQL Server or later. The sqlcmd commands cannot connect to the local SQL Server instance due to untrusted certificates.
To Reproduce
Expected behavior
The setup script should successfully execute the SQL scripts (FoundationConfigurationSchema.sql and UniqueCouponSchema.sql) against the Commerce database without SSL certificate errors.
Desktop (please complete the following information):
OS: Windows 11 Pro
SQL Server: 2025 (Developer Edition)
ODBC Driver: 18 for SQL Server
Additional context
ODBC Driver 18 for SQL Server enforces SSL/TLS encryption by default and requires trusted server certificates. For local development environments, the -C flag needs to be added to sqlcmd commands to trust the server certificate.
Solution:
Add the -C flag to line 105 in setup.cmd:
Before:
set sql=sqlcmd -S %SQLSERVER% %ADDITIONAL_SQLCMD%
After:
set sql=sqlcmd -S %SQLSERVER% %ADDITIONAL_SQLCMD% -C