To generate self-signed certificate we will use makecert.exe. You will need to first download windows sdk for windows 7 or later.

Download and install Windows SDK.

Once you have downloaded and installed windows sdk. Go to sdk folder by executing below command.

cd C:\Program Files (x86)\Windows Kits\10\bin\x64

Generate Root CA

Now, we will generate root certificate. We will use the root ca certificate to bind with client certificate later in this article.

makecert -sky exchange -r -n "CN=MyRootCert" -pe -a sha256 -len 2048 -ss Root

The above command will generate root ca and load it in Trusted Root Certificate -> Certificates folder.

Create client certificate

makecert.exe -n "" -pe -sky exchange -m 96 -ss My -in "MyRootCert" -is root -a sha256

The above command will create client certificate called with MyRootCert binded together and load it in Personal -> Certificates folder under your user profile.

NOTE: If you have Windows 10 or Windows Server 2016 OS. You can use native PowerShell cmdlets to generate self-signed certificate.