Error: Certificate Is Invalid With Validity Period
Issue
When attempting to establish a secure connection to SQL Server using Fivetran, the connection fails with the error:
'encrypt' property is set to 'true' and 'trustServerCertificate' property is set to 'false' but the driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption: Error: Certificate is invalid with validity period.
Environment
Connector: SQL Server
Resolution
To resolve this issue, do the following:
To learn how to view, install, and assign SQL Server certificates, see the SQL Server documentation on certificate management.
Confirm that the SSL certificate used by SQL Server is valid and hasn't expired.
If the certificate has expired, issue a new certificate with a valid date range and install it on the SQL Server host.
If multiple certificates exist in the Windows certificate store, SQL Server may not automatically select the correct one. Configure SQL Server to use the intended certificate in SQL Server Configuration Manager.
Set the
encryptproperty totrue. This ensures the connection uses SSL and that SQL Server presents a valid certificate.In Fivetran, click Save & Test to test your connection.
If the issue persists and you're using a self-signed certificate, set the trustServerCertificate property to true and test the connection. This setting bypasses SSL certificate checks and can help confirm that certificate validation is causing the issue. After testing, revert the property to false.
If the issue continues after completing these steps, contact our support team.
Cause
This issue occurs when SQL Server presents an SSL certificate with an invalid or expired validity period, preventing us from establishing a secure connection. You may also encounter this error if multiple certificates are present in the Windows certificate store and SQL Server presents the wrong one.