Skip to main content
Question

How to connect to SQL Server while setting trustServerCertificate=true

  • February 7, 2018
  • 1 reply
  • 330 views

fmelizard
Safer
Forum|alt.badge.img+21

I'm trying to create a connection to my Microsoft SQL Server database while setting the connection parameter trustServerCertificate=true. 

But I see this in my log file:

Creating connection using connection string 'jdbc:sqlserver://********' and properties '{integratedSecurity=false, trustServerCertificate=false, user=***, password=************, applicationName=Safe Software FME, database=******, encrypt=true}

Is there a way to set this to true?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

ravenkopelman
Safer
Forum|alt.badge.img+1

Currently both the trustServerCertificate and encrypt values in the connection string are controlled by the Encrypt Connection option in the SQL Server connection definition.

If you uncheck Encrypt Connection, trustServerCertificate will be set to true and encrypt to false.

There is a security argument to be made that encryption without identity verification leads users to believe they are much more secure than they really are, which is why the two settings are tied together. If there is sufficient demand for these settings to be disentangled it will be considered.

A workaround would be to use the vanilla JDBC format, where you can specify your own connection string. Then you could create the desired combination of settings.