SQL Server Fallback SSL certificate

Prem 26 Reputation points
2022-03-23T00:21:02.107+00:00

Hi

I am trying to find information on the SQL Server Fallback SSL certificate. The 2 questions I trying to find info on are:

  1. Where is the fallback certificate stored? Is it in-memory, is it in master.sys.certificates or somewhere else.
  2. When "Force Encryption" is set to Yes on the SQL Server instance and we don't have our own certificate and instead rely on the SQL fallback certificate, why do clients trust this certificate even if the "Trust Server Certificate" option (in SSMS) is unchecked.

I have looked at MS Docs extensively I can't find any resource that gives me answers for the above. The links I am finding are related to how we can install and configure our own cert e.g. below

MS Docs - Manage Certificates
MS Docs - Enable Encrypted Connections to the Database Engine

Any help or pointers is appreciated.

Thanks
Prem

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,809 questions
{count} vote

Accepted answer
  1. CathyJi-MSFT 21,096 Reputation points Microsoft Vendor
    2022-03-24T02:39:58.9+00:00

    Hi @Prem ,

    > If we can find an MS Docs source that tells us where the fallback cert resides

    I did some research and test, I can’t find any MS document that offer this information. But I can share you some information about this based on my researching and test.

    We can’t find the location of self-signed server certificate that generated automatically by SQL server in registry and MMC. But we can find the self-signed server certificate that generated manually in MMC, under Local Computer account , Personal, Certificates. You can do a test following this blog.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".


1 additional answer

Sort by: Most helpful
  1. CathyJi-MSFT 21,096 Reputation points Microsoft Vendor
    2022-03-23T02:57:02.457+00:00

    Hi @Prem ,

    >Where is the fallback certificate stored? Is it in-memory, is it in master.sys.certificates or somewhere else.

    Quote from this thread ;

    By default, the certificate is located in the registry, at:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.x\MSSQLServer\SuperSocketNetLib

    (Where the MSSQL.x is MSSQL.x is a placeholder for the corresponding value of the instance of SQL Server.)

    If SQL server cannot find a certificate at that location, it will fall back to searching the certificate store for a certificate with the FQDN of the computer it is installed on. By default, that certificate would be the machine certificate, found in Local Computer -> Personal -> Certificates through the MMC Certificates snap-in.

    You would check the key length (and other properties) of this (or any) certificate through the MMC Certificates snap-in, by browsing to it, double clicking on it, and then hitting the Details tab in the ensuing dialogue box that comes up for the certificate.

    >When "Force Encryption" is set to Yes on the SQL Server instance and we don't have our own certificate and instead rely on the SQL fallback certificate, why do clients trust this certificate even if the "Trust Server Certificate" option (in SSMS) is unchecked.

    Quote from MS document;

    To enable encryption when a certificate has not been provisioned on the server, the Force Protocol Encryption and the Trust Server Certificate options must be set in SQL Server Configuration Manager. In this case, encryption will use a self-signed server certificate without validation if no verifiable certificate has been provisioned on the server.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".