DetailPage-MSS-KB

Microsoft small business knowledge base

Article ID: 276553 - Last Review: September 17, 2011 - Revision: 11.0

This article was previously published under Q276553

On This Page

SUMMARY

This step-by-step article lists the steps that you must use to enable Secure Socket Layer (SSL) encryption for Microsoft SQL Server 2000 if you have a valid Certificate Server in your network environment. If you have purchased certificates from a third-party certificate vendor, follow the instructions provided by the vendor. SQL Server 2000 permits encrypted connections over all network libraries by using certificates and SSL encryption. You can enable SQL Server encryption by using the SuperSocket Net-Library, Ssnetlib.dll or Dbnetlib.dll

If you use SSL Encryption on a SQL Server cluster, you can use the same procedures except that the certificate must be issued to the fully qualified domain name of the Virtual SQL Server and not the individual computer name. In addition, the way Microsoft recommends that you use Certificates and SSL encryption on a SQL Server cluster is:
  1. Install the certificates on each node in the cluster.
  2. Install the Trusted Root Authority on each client.
  3. Enable the Force Protocol Encryption option from the client computers by using the Client Network Utility.
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
319349  (http://support.microsoft.com/kb/319349/ ) BUG: Turning on the "Force Protocol Encryption" option is irreversible if there is no certificate
To encrypt communication between a client computer and a server, you must first decide if you want the encryption to be per server or on a per client basis. Keep in mind that there is a current SQL Server limitation if you enable encryption on the server. Encryption will be for all incoming connections. If you enable encryption on the client computer, all outgoing connections from that client try to make an encrypted connection to any SQL Server.

Additionally, when you enable Force Protocol Encryption from the server, it encrypts the logins and data. However, it does not require the client to trust the same root authority. If you prefer the client to trust the same root authority, you must use Client Network Utility or the connection string option to force protocol encryption on the client. This is by design.

SQL Server does not start if the certificate is invalid or if the service account that was used to start the MSSQLServer service cannot locate the certificate. Therefore, Microsoft recommends that you request the certificate while you are logged on by using the same user account that you used to start the MSSQLServer service.

If Microsoft Internet Information Services (IIS) is installed on the computer that is running SQL Server, you can also use the IIS Service Manager Wizard on the Directory Security tab. The certificate must be a server certificate that was issued to the fully qualified domain name (FQDN) of the server. You cannot use the IP address for the certificate name. A client computer must request the connection to the server by the FQDN or NetBIOS name of the server. You cannot connect to the server by using the IP address of the computer that is running SQL Server.

If the computer has multiple certificates installed in the user store or in the machine store, you may have to specify which certificate should be used for SQL Server.

Create a Certificate value of type REG_BINARY in the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer\SuperSocketNetLib
Click on the Certificate value, and then type the thumbprint property value of the certificate in the data column.

As an example, the registry should appear similar to the following when you export it:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer\SuperSocketNetLib] "Certificate"=hex:2e,67,3e,84,4a,4f,e0,7f,08,42,6a,7a,35,9b,01,94,76,67,0b
If this registry key is set to 0 on the computer, the computer ignores the certificates on the computer. The computer that is running SQL Server will start but not read the certificate on the computer. If you want to use encryption and the computer only has one certificate, you do not need this registry key.

The only way to verify that you have successfully made an encrypted connection is to capture the traffic between two computers by using Microsoft Network Monitor or a Network Sniffer tool. For more information about how to setup Microsoft Network Monitor, click the following article number to view the article in the Microsoft Knowledge Base:
243270  (http://support.microsoft.com/kb/243270/ ) How to install Network Monitor in Windows 2000

Request and install a certificate by using a certificate server

  1. Make a HTTP connection to the certificate server while you are logged on by using the same account that you used to start the MSSQLServer service. For example, you can make the following connection:

    Note
    Microsoft recommends that you start the MSSQLServer service by using a domain user account or a local user account that has minimal privileges and not the local system account.
  2. Select Request a certificate, and then click Next.
  3. In the Choose Request Type: page, click to select Advanced request, and then click Next.
  4. Select Submit a certificate request to this CA using a form, and then click Next.
  5. Enter the fully qualified domain name of your computer in the Name box. Ping your computer to get the fully qualified domain name if you are not sure what it is.
  6. In the Intended Purpose section, change the selection to Server Authentication Certificate by using the drop-down list box from the Client Authentication Certificate. For an Enterprise Certificate Authority you would choose a template instead.
  7. Click the Store certificate option in the local computer certificate store.
  8. Leave all other items as the default. Click Submit.
  9. The last page presents you with a Certificate to Install hyperlink. Click Install this certificate.
To verify that your certificate installation is correct, use either the MMC Certificate snap-in to verify the certificates or use the CertUtil.exe tool that is installed on the certificate server to list the certificates. To load the MMC Certificate snap-in, follow these steps:
  1. To open the MMC console, click Start, and then click Run.
  2. In the Run dialog box, type mmc, and then click OK.
  3. On the Console menu, click Add/Remove Snap-in.
  4. Click Add, and then click Certificates.
  5. Click Add.

    You are prompted to open the snap-in for the current user account, for the service account, or for the computer account.
  6. Click Computer Account.
  7. Click Local computer, and then click Finish
  8. Click Close.
  9. Click OK.

    Your installed certificates are located in the Certificates folder in the Personal container.
Double-click the certificate, and then make sure that all the following are true:
  • A private key corresponds to this certificate.
  • The certificate Subject Name is equal to the FQDN of the computer.
  • The intended purpose of the certificate is for server authentication.
  • The certificate path has a valid chain to the root authority.

Enable SSL encryption on the SQL Server

After the certificate is installed on the server, you can enable SSL encryption by following these steps:
  1. Use the SQL Server Network Utility and click to select the Force protocol encryption check box.
  2. Stop, and then restart the MSSQLServer service for the Default Instance or Named Instance.
  3. Use the SQL Server error log to verify that SQL Server did not report any errors when it started.

Enable SSL encryption for a specific client

If you do not want to enable SSL encryption globally at the server, you can enable SSL encryption from specific clients. Do not enable SSL encryption on both the server and client, use one or the other. If you enable SSL encryption on a per client basis, the client computer must trust the server certificate. The certificate must already exist on the server. The client computer does not require a certificate, but it must have the server certificate as a Trusted Root Certificate Authority. Follow these steps to enable SSL encryption on a per client basis:
  1. Make sure that you disable or clear the Force protocol encryption option in the Server Network Utility.
  2. Make a test connection from a client computer by using the Network Monitor or a Network Sniffer tool to verify that the communication between a client and server computer is not encrypted.
  3. Right-click the Internet Explorer icon that is located on the Desktop on the computer that is running SQL Server.
  4. Right-click Properties.
  5. Click the Content tab.
  6. Click Certificates.
  7. Click Trusted Root Certification Authorities.
  8. Click to select Certification Authority.
  9. Click Export, and then click Next.
  10. In the Export File Format dialog box, click Cryptographic Message Syntax Standard - PKCS #7 Certificates (.P7B).
  11. Click to select the Include all the certificates in the certification path if possible check box.
  12. Select a file name for the exported certificate. Make sure that the file location is somewhere that the client computer can later access to import it.
  13. Click Next, and then click Finish.
  14. On the client computer, select your Internet browser, right-click Properties, point to Content, and then click Certificates.
  15. Click the Trusted Root Certification Authorities tab.
  16. Click Import, click Next, click Browse, and then click Change Files of type to: PKCS #7 Certificates(*.p7b).
  17. Select the certificate you just exported from SQL Server, and then click Open. Click Next.
  18. Click to select the Automatically select the certificate store based on the type of certificate check box.
  19. Click YES to add the following certificate to the root store.
  20. Click Next, and then click Finish.
  21. A dialog box opens with the text:
    The import was successful.
  22. Verify that the certificate appears under the Trusted Root Certificate Authorities, and that Intended Purposes indicates All.
  23. Click View to verify that no errors were reported with the certificate.
  24. Click the Certification Path tab, and then check the Certificate status to see if it is set to OK.
  25. Open the Client Network Utility, and then click to select the Force protocol encryption check box.

Test the encryption from a client

To test the encryption from a client, use one of the following methods:
  • Use the Query Analyzer tool.
  • Use any ODBC application where you can change the connection string.

Query Analyzer

To test with the SQL Query Analyzer tool, follow these steps:
  1. Use the SQL Server Client Network Utility.
  2. Click to select the Force protocol encryption check box.
  3. Connect to the server that is running SQL Server 2000 by using Query Analyzer.
  4. Monitor the communication by using Microsoft Network Monitor or a Network Sniffer.

ODBC application

To test with an ODBC application, follow these steps:
  1. Modify the ODBC or OLEDB connection string:

    ODBC
    Driver=SQLServer;Server=ServerNameHere;UID=UserIdHere;PWD=PasswordHere;Network=DBNETLIB.DLL;Encrypt=YES
    						
    OLEDB
    Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=dbNameHere;Data Source=ServerNameHere;Use Encryption for Data=True
  2. Connect to the computer that is running SQL Server 2000 and monitor the communication by using Microsoft Network Monitor or a Network Sniffer.

REFERENCES

For more information, click the following article number to view the article in the Microsoft Knowledge Base:
316898  (http://support.microsoft.com/kb/316898/ ) How to enable SSL encryption for an instance of SQL Server by using Microsoft Management Console

APPLIES TO
  • Microsoft SQL Server 2000 Standard Edition
  • Microsoft SQL Server 2000 64-bit Edition
Keywords: 
kbhowtomaster KB276553
Share
Additional support options
Ask The Microsoft Small Business Support Community
Contact Microsoft Small Business Support
Find Microsoft Small Business Support Certified Partner
Find a Microsoft Store For In-Person Small Business Support