Have your tried adding Encrypt=false
to your connection string? or as mentioned above TrustServerCertificate=True
In addition, you can also check that if you have added the TCP port and UDP port(1434) in the inbound rule of the Windows Firewall, and you can verify TCP port in SQL Server Configuration Manager. For more details about configuring remote access for SQL Server, please review the following blog.
2 other tasks :
- Check Firewall and Network Security Rules
- Consider Azure Active Directory Authentication