In this example we are going to generate a self-signed certificate that will be valid for ten years using PowerShell as Administrator user.
In this example the server has a hostname „testserver-01“ and we will use „3dfindit-testserver-01“ as a friendly name. For a friendly name you can add anything you want or use something a bit descriptive so that you can easily find your certificate if there are more of them for the same host. The local server user is „root“.
The certificate is created on the server. In the case of a manual creation, permissions have to be added to the certificate for local server user that will access the AppServer.
Next step is to export the created certificate and import it in the server's "Local Computer\Trusted Root Certification" store, and distribute the exported certificate to the clients and import the certificate in the same location as server's, meaning Local Computer\Trusted Root Certification store.
The PowerShell command is as follows:
New-SelfSignedCertificate -CertStoreLocation Cert:\LocalMachine\My -DnsName "testserver01" -FriendlyName "3dfindit-testserver-01" -NotAfter (Get-Date).AddYears(10)
In order to add permissions on the certificate, run the Windows Certificate Manager (Windows-key + R-key -> certlm.msc ).
Under Certificates - Local Computer -> Personal -> Certificate you can see the generated self-signed certificate.
Right-click on the certificate and select All tasks -> Manage Private Keys....
Click to add a local server user (in this case user "root") to the list of users that have permissions to use the certificate.
In the Select Users or Groups window, enter the username (in this case user "root") in the box Enter the object names to select and select .
We should get an output in the Enter the object names to select box in the format "HOSTNAME\username" as in this example "TESTSERVER-01\root" after you have selected .
If this was done in a domain environment the output would be: „Name (username@domain)“. For example: „user name (i.cabraja@cadenas.de)“
-> In the security window, you will have user root on the list under Groups or user names with permissions Allow for Full control and Read.
Select and permissions on the certificate for the user "root" have been successfully added.
To export the certificate right-click on the certificate and select All Tasks -> Export.
-> The Certificate Export Wizard is opened.
Select No, do not export the private key and select .
Select DER encoded binary X.509 (.CER) and .
Select the location and a name for the exported certificate and select and select (In this example the location will be the C:\ drive and the name of the file will be certificate ).
Select and . The export process is done. Distribute the exported certificate to all clients.
In the next steps the certificate will be imported first on the server and then on the clients.