Hi Friends,
After 3 posts on Database Corruption, I hope you would not mind if I divert my attention a bit and post some blogs related to some other topics. This topic that I going to write about is a very interesting topic; so I thought of taking some time out to write a few lines regarding this.
In this post, I will be writing about enabling Server Side Encryption in SQL Server. All of us know that to enable Server Side Encryption, we need a certificate. However, there is a very strange issue involved into this as well. Before I actually go ahead and explain the issue, I would like to spend a few lines about the properties of the certificate that are required, and how SQL Server loads that certificate to encrypt incoming and outgoing data.
The prerequisites for using a certificate for Server Side Encryption in SQL Server are:
What happens when SQL Server tries to start when "Force Protocol On" is turned on:
2007-07-16 08:57:03.66 server Encryption requested but no valid certificate was found. SQL Server terminating. 2007-07-16 08:57:03.66 server Error: 17826, Severity: 18, State: 1 2007-07-16 08:57:03.66 server Could not set up Net-Library 'SSNETLIB'.. 2007-07-16 08:57:03.66 server Unable to load any netlibs. 2007-07-16 08:57:03.66 server SQL Server could not spawn FRunCM thread.
That said, let me come to the issue we were facing. We had a machine which had SQL Server installed. The FQDN of the machine was SQLServerMachine.Foo.Bar.local. We had a certificate created for this machine. The properties of this certificate perfectly matched the requirement. In our case, we had the following:
However, when we tried to start the SQL Server, it would not start, and threw the error message as discussed above in the SQL Server Errorlog. We did a lot of research to try to figure out the cause of the issue, and what we found is really really interesting.
In our case, we had the thumbprint value of the certificate as: 32 77 5c 23 e9 d8 23 cc 00 68 79 21 92 fd 23 f1 35 99 b7 c3
We figured out that the problem was being caused due to the two consecutive zero's in the thumbprint which was interpreted as a NULL by SQL Server. So, when the SQL Server instance was reading the thumbprint of the certificate from the registry, it interpreted the thumbprint as 32 77 5c 23 e9 d8 23 cc 00. It tried to match the thumbprint of the certificate with the thumbprints of the certificates available in the Current User Store of the SQL Server Service Account and the Local Computer Store. Obviously, it did not find a match, and thereby threw the errors and stopped.
Workaround to the issue:
There are actually two workarounds to the issue:
I hope this post will be useful to my readers.
Disclaimer: All information provided here is my personal opinion and is neither verified nor approved by Microsoft before it is published. All information, and code samples, if any, is provided "AS IS" with no warranties and confers no rights.
PingBack from http://microsoft-sharepoint.simplynetdev.com/server-side-encryption-in-sql-server/
Thanks for this. While its not actually my problem, it has helped me understand better how certificates are assigned within SQL Server 2005.
Hi Jim,
Thanks for the comment. I am glad to be able to help you.
Regards,
Suhas