Problems connecting to SQL server when using some versions of Microsoft.Data.SqlClient library (e.g. 4.1.0) #7650
Labels
kind/bug
This issue represents a verified problem we are committed to solving
Team
Severity
One customer impacted so far, but could impact others. Workaround isn't good because it means vulnerability to MITM attacks..
Version
Found in 2022.2.6971 after upgrading from 2022.1.2232
Latest Version
No response
What happened?
Octopus was upgraded from 2022.1.2232 to 2022.2.6971 using the Docker base image from Docker Hub. Octopus image runs in ECS in AWS and connects to an RDS SQL Server Instance. This uses the rds-ca-2019 Certificate Authority for encryption.
Connection string prior to the upgrade had
;Encrypt=True;TrustServerCertificate=False
.Unable to start Octopus 2022.2.6971 with the error:
System.Security.Authentication.AuthenticationException: The remote certificate was rejected by the provided RemoteCertificateValidationCallback.
It looks like this may have to do with the SqlClient library changing versions from 2.1.0 to 4.1.0, and there is likely a bug in 4.1.0 which was fixed in 5.0.0: dotnet/SqlClient#1402
Reproduction
Reported by user [internal]: https://octopus.zendesk.com/agent/tickets/92367
Error and Stacktrace
More Information
It looks like the version of Nevermore and therefore the SqlClient were changed between Octopus 2022.1.2232 and 2022.2.6971:
2022.1.2322 - 16.3.5 Nevermore, 2.1.4 SqlClient
2022.2.6971 - 18.1.0 Nevermore, 4.1.0 SqlClient
Workaround
Modify connection string - set
TrustServerCertificate=True
The text was updated successfully, but these errors were encountered: