Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can "additional connection parameters be "saved" in SSMS?

Our staging server has identical settings to the production server which means encrypted communication is turned on, however the staging server has self signed cert which we all know will fail unless TrustServerCertificate=true; is part of the connection string. When connecting via SSMS all other connection details are remembered from sessions to session except the ones in the additional connection parameters box.

Inevitably I forget, get error, have to click to Options, then Addtional ... enter the string and hit connect again.

Why Microsoft decided that two of the three tabs should be remembered but not the third one is beyond me.

So if there a way around this? Some config file which specifies the default settings? So way to launch SSMS from command line including specific connection string and go around it by making a shortcut?

Or am I doomed to forever .... forget. connect. error. options. tab. type. connnect. ?

Additional Connection Parameters

like image 738
Gerald Davis Avatar asked Jan 07 '14 22:01

Gerald Davis


2 Answers

I accepted the answer about no solution, vote it up as that answers the direct solution however I did find a workaround.

In the connection properties of the SQL SERVER (not SSMS) one can force an encrypted connection. This will require SSMS to connect encrypted regardless of if the "Encryption connection" property is set.

Somewhat illogically if the server forces an encryption connection, SSMS will connect without error (or even warning) if the server provides a self signed cert.

To force encrypted connections on SQL SERVER.

  1. Start SQL Server Configuration Manager.
  2. Expand the tree view option SQL Server Network Configuration.
  3. Right click on Protocols for INSTANCENAME and select properties (note this is the actual protocols property not the properties of a specific protocol).
  4. On the Flags tab set Force Encryption to Yes.
  5. Restart the SQL Server Instance Service.

You can now connect with SSMS without checking encryption connection and the server will force that encryption regardless. It seems counter-intuitive in my opinion but there will be no error or warning that you are connecting using a self signed cert.

In SSMS you can verify the encryption status of all active connections the following query (uncomment the last line to show only the current connection):

SELECT encrypt_option 
FROM sys.dm_exec_connections 
-- WHERE session_id = @@SPID
like image 156
Gerald Davis Avatar answered Sep 26 '22 07:09

Gerald Davis


Nope, sorry. The additional parameters are not persisted across sessions.

Since this is something it sounds like you'd like changed I'd suggest submitting a suggestion on the SQL Server Connect site and then getting people to vote it up.

UPDATE : This was finally fixed and you should now see the additional parameters field saved just like the other connection options. It's currently only available in the CTP version of SSMS though.

like image 41
Charles Gagnon Avatar answered Sep 23 '22 07:09

Charles Gagnon