Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server error after update: The token supplied to the function is invalid

Tags:

sql-server

I was using my machine (and SSMS) and everything was working fine. I did a reboot whereupon Windows 10 applied the following updates:

Windows Malicious Software Removal Tool for Windows 8, 8.1, 10 and Windows Server 2012, 2012 R2, 2016 x64 Edition - April 2017 (KB890830)
Security Update for Adobe Flash Player for Windows 10 Version 1607 (for x64-based Systems) (KB4018483)
Security Update for Microsoft Silverlight (KB4017094)
Cumulative Update for Windows 10 Version 1607 for x64-based Systems (KB4015217)

Now when I try to login in SSMS I'm getting the following error:

A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The token supplied to the function is invalid (Microsoft SQL Server)

The token supplied to the function is invalid

This looks like it is security related, but I don't know what to do to fix it. My machine uses Windows Server Essentials for backups (and the connector is green).

like image 498
WhiskerBiscuit Avatar asked Apr 13 '17 14:04

WhiskerBiscuit


2 Answers

It seems that others have had success simply by restarting the machine's IIS.

That would be as simple as this:

Click Start, click Run type IISReset, and then click OK. SOURCE (Microsoft)

Otherwise, there are some settings in SSCM that you might need to ensure are properly set, and which may be culprits for a wide range of issues:

  1. ensure Shared Memory protocol is enabled
  2. ensure Named Pipes protocol is enabled
  3. ensure TCP/IP is enabled, and s ahead of the Named Pipes in the settings SOURCE (SO)

(These settings are in your SSCM). There is also a nice blog post about setting these settings as a solution for a different error.

I hope this helps spark some ideas! It seems like this is a fairly common issue without very many concrete suggestions for solutions.

If none of those work (I thought I would suggest them as due diligence in case they resolved the issue), you might have to look into what is being modified by Windows Malicious Software Removal Tool.

Other people have run into issues using SSMS after similar updates in the past, and they seem to offer Internet Explorer as the offender. To fix it, they unregistered and registered their ieproxy.dll.

They suggest doing:

  • Launch command line in administrative mode. Go to C:\Program Files\Internet Explorer or c:\Program Files (x86)\Internet Explorer if you have Win x64.
  • Execute regsvr32 /u ieproxy.dll (this might throw an error if it isn't loaded)
  • Execute regsvr32 ieproxy.dll SOURCE (SO)

This seems to have been successful for them, hope it works!

like image 132
cosinepenguin Avatar answered Oct 12 '22 14:10

cosinepenguin


Just answering my own question for posterity:

Open MMC and select the certificates add-on for local computer. Open up the server certificate and disable server and client authentication purposes. Restart SQL server. Finished.

like image 27
WhiskerBiscuit Avatar answered Oct 12 '22 15:10

WhiskerBiscuit