How to generate a self-signed SSL certificate for MS SQL server 2008 R2 using OpenSSL?
I managed to generate a self-signed certificate that works for encryption of connections to MS SQL Server by using the New-SelfSignedCertificate command for PowerShell.
Example:
New-SelfSignedCertificate -Type SSLServerAuthentication -Subject &quot;CN=$env:COMPUTERNAME&quot; -DnsName &quot;$env:COMPUTERNAME&quot;,'localhost.' -KeyAlgorithm &quot;RSA&quot; -KeyLength 2048 -Hash &quot;SHA256&quot; -TextExtension &quot;2.5.29.37={text}1.3.6.1.5.5.7.3.1&quot; -NotAfter (Get-Date).AddMonths(36) -KeySpec KeyExchange -Provider &quot;Microsoft RSA SChannel Cryptographic Provider&quot; 

Running it:
C:\mssql&gt;notepad create-ss.ps1

C:\mssql&gt;powershell
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

PS C:\mssql&gt; .\create-ss.ps1


   PSParentPath: Microsoft.PowerShell.Security\Certificate::LocalMachine\MY

Thumbprint                                Subject
----------                                -------
14151D156A16557AAA67A4C9465631520CC18626  CN=WIN-9U7N81SI03H


Use of the certificate:

Giving access to the certificate private key is required as well.
Find the account used to run MS SQL Server:

Now from Management Console, Certificates Add-on, Select Manage Private Keys

Add the user running MS SQL

Restart MS SQL Server and you should be done.