Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL error on sql client for integration tests #80

Closed
pdevito3 opened this issue May 27, 2022 · 1 comment
Closed

SSL error on sql client for integration tests #80

pdevito3 opened this issue May 27, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@pdevito3
Copy link
Owner

pdevito3 commented May 27, 2022

Steps to reproduce

Running integration tests for sql server cause this:

OneTimeSetUp: Microsoft.Data.SqlClient.SqlException : A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.)
Data:
  HelpLink.ProdName: Microsoft SQL Server
  HelpLink.EvtSrc: MSSQLServer
  HelpLink.EvtID: -2146893019
  HelpLink.BaseHelpUrl: https://go.microsoft.com/fwlink
  HelpLink.LinkId: 20476
  ----> System.ComponentModel.Win32Exception : The certificate chain was issued by an authority that is not trusted.
  Exception doesn't have a stacktrace

Further technical details

Craftsman version (dotnet tool list -g): 14.x

@pdevito3 pdevito3 added the bug Something isn't working label May 27, 2022
@pdevito3
Copy link
Owner Author

This is because sql client v4 had a breaking change to have encrypt set to true by default

https://docs.microsoft.com/en-us/sql/connect/ado-net/introduction-microsoft-data-sqlclient-namespace?view=sql-server-ver15#breaking-changes-in-40

Need to set it to false in the connection string:

dockerConnectionString += ";TrustServerCertificate=True;"; Environment.SetEnvironmentVariable("DB_CONNECTION_STRING", dockerConnectionString);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant