I’m writing this for an issue I'm facing when I'm connecting SQL Server using direct socket (C++) on port 1433 (or any other port, not using any kind of driver like ODBC). The connection is getting succeeded and I'm able to execute queries. The issue start popping when using Encrypt=True but without TrustServerCertificate=True flag (default is false). Furthermore, I tested this in TLS 1.2 environment too with all valid certificates.
The only combination is working when I'm setting both Encrypt=True and TrustServerCertificate=True flags. But TrustServerCertificate=True is not accepted by customer. They need supporting docs or links for this.
Did anyone faced this issue? Is there anything I'm missing while connection? or any supporting docs/links related to this?