How do I get a certificate for a SQL Server database?

  • I'm working on a new application at home, using SQL Server 2019 Developer Edition. I'm trying to scaffold a DBContext to my local database, but am getting this error:

    A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.)

    I searched that error which brought me to this Stack Overflow article. I'm tempted to go with the quick fix of "Encrypt=false" in the connection string, because this is in my home environment and on my laptop; it isn't exposed to the outside world.

    But I see all the dire warnings against doing that and the recommendations of using Let's Encrypt to get a certificate for the database. I've used Let's Encrypt before for websites, never for a database. I've no idea at all how to apply a certificate to a database. How do you do that?

     

    Rod

  • TrustServerCertificate=True is the setting you need. Or something like that ... I'm not at my computer right now.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • The following give some details on using Let's Encrypt with SQL Server. My understanding is the SQL Server service account only requires READ access to the private key; not FULL CONTROL as stated in the article. I did start looking at this but we then got our own CA server which made life a lot easier.

    How to Configure SQL Server to Use Let’s Encrypt Certificates – Natural Born Coder

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply