In this video we will learn how to encrypt incoming connections to SQL Server. For this we have Transport Layer Security (TLS) certificates which are widely used to secure access to SQL Server.
We can encrypt all incoming connections to SQL Server or we can also enable encryption for just a specific set of clients.
For either of these scenarios, we have to first configure SQL Server to use a certificate that meets some Certificate requirements for SQL Server in order to encrypt the data.
Download OpenSSL installation file.
https://slproweb.com/products/Win32Op...
****Commands**
Generate a Private Key
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out myprivatekey.key -aes256
Use private key and create a configuration file
openssl req -new -key myprivatekey.key -out mycsr001.csr -config openssl_csr_sample.conf
Use below command to self-sign your CSR and create your own certificate. This is common for testing, internal tools, or local apps
openssl x509 -req -in mycsr001.csr -signkey myprivatekey.key -out mycertificate.crt -days 365
**********Configuration File**********
OpenSSL configuration file for generating a Certificate Signing Request (CSR)
[req]
default_bits = 2048
default_md = sha256
prompt = no
distinguished_name = req_distinguished_name
req_extensions = v3_req
[req_distinguished_name]
C = IN
ST = DEL
L = NewDelhi
O = bksqlforest
OU = IT
CN = bksql001.bksqlforest.com
[v3_req]
End-entity certificate settings
basicConstraints = critical, CA:FALSE
keyUsage = critical, digitalSignature, keyEncipherment
For standard TLS server certificates, use serverAuth.
Add clientAuth only if the certificate will also be used for mutual TLS.
Example: extendedKeyUsage = serverAuth, clientAuth
extendedKeyUsage = serverAuth
Subject Alternative Names (SANs) must include every hostname this certificate should cover.
Include the primary FQDN from CN in the SAN list as DNS.1.
subjectAltName = @alt_names
[alt_names]
DNS.1 = bksql001.corp.bksqlforest.com
DNS.2 = bksql001
DNS.3 = REPLACE_WITH_ADDITIONAL_FQDN
...
DNS.30 = REPLACE_WITH_ADDITIONAL_FQDN
****************************************************
Microsoft Documentation:
https://learn.microsoft.com/en-us/sql...
https://learn.microsoft.com/en-us/sql...
https://learn.microsoft.com/en-us/sql...