Information and announcements from Program Managers, Product Managers, Developers and Testers in the Microsoft Virtualization team.
In an earlier post, we discussed the steps required to get a certificate from a Standalone CA or from a third party CA. For an Enterprise CA, the INF file needs to be modified and suitable templates need to be available to honor the certificate request.
To make things interesting, the post is written for a deployment where both the primary and replica serves are part of a cluster where a SAN (Subject Alternative Name) certificate is being used for achieving certificate based authentication. It’s worth calling out two points:
Step #1: Setup an Enterprise CA
For this post, I have setup an Enterprise CA (called frtest-new-ent-ca) on Windows Server 2012 RC build. The configuration is straight forward and is achieved by enabling the Active Directory Certificate Services (ADCS) role and configuring an Enterprise CA.
To deploy SAN certificates, the CA needs to be configured to accept the SAN attribute from the request file. Issue the following commands from an elevated command prompt on the machine on which the Enterprise CA is configured:
certutil -setreg policy\EditFlags +EDITF_ATTRIBUTESUBJECTALTNAME2
net stop certsvc
net start certsvc
Step #2: Manage/Create a template
An out-of-box installation of the ADCS role does not have a template which can be reused for Hyper-V Replica. You would need to duplicate an existing template using the following steps:
Snips from a sample template (called Hyper-VReplica) are shown below. General: Compatibility: Extensions: Security: Issuance Requirements: Subject Name:
Snips from a sample template (called Hyper-VReplica) are shown below.
In case you missed the blog post introduction, this is just one possible template configuration which can be used to issue SAN certificates for Hyper-V Replica. If the above conditions are broadly met in other templates, skip step #2, and use any existing template.
Step #3: Create SAN certificate on the primary cluster
certutil -f -config "servername\frtest-new-ent-ca" -ca.cert EntCA.CER
Import this certificate into the Trusted Root Certification Authorities store of the Local computer. This is an optional step as the root certificate might already be installed in your servers.
[Version]
Signature="$Windows NT$
[NewRequest]
Subject = "CN=SANCert" ; Can be any server name/string
Exportable = TRUE; Private key is exportable
KeyLength = 2048; Common key sizes: 512, 1024, 2048,
KeySpec = 1
KeyUsage = 0xA0 ; Digital Signature, Key Encipherment
MachineKeySet = True
ProviderName = "Microsoft RSA SChannel Cryptographic Provider"
ProviderType = 12
RequestType = CMC
[RequestAttributes]
CertificateTemplate = "Hyper-VReplica" ; Name of the template which was created
SAN="dns=demo-pri1.contoso.com&dns=demo-pri2.contoso.com&dns=pribroker.FRTEST.nttest.microsoft.com" ; FQDN of the nodes which make up the cluster, plus the Hyper-V Replica Broker CAP
Save the above file as SAN.inf
certreq -new SAN.inf SAN.req
certreq -submit -config "servername\frtest-new-ent-ca" SAN.req SAN.cer
certreq -retrieve 19 SAN.cer
Step #4: Create SAN certificate on the replica cluster
That’s it, you are good to go! You now have a setup which has SAN certificates which have been issued by your Enterprise CA. These certificates can be used on the replica and primary cluster to receive and enable replication respectively.
Hi Guys.
Great article! Well done.
In case I need to do the same process, but for a single Hyper-V Replica, I noticed I don't need to use SANs. It worked normally without it.
In this scenario without SAN, do I need to run the command certutil -setreg policy\EditFlags +EDITF_ATTRIBUTESUBJECTALTNAME2 on the CA server?
Thanks.
Hi,
Correct. The certutil setreg command is only required if you plan to use SAN certificates. For a standalone Hyper-V Replica server, a certificate with the subject name set to the machine name should be sufficient (with all other conditions being met). The inf file would look similar to the one mentioned in the previous post blogs.technet.com/.../requesting-certificates-for-hyper-v-replica-from-cas.aspx while the submission steps (assuming you are using an Enteprise CA) would be the one mentioned in this post.
Praveen
Certificate Request Processor: The parameter is incorrect. 0x80070057 (WIN32: 87)
please help ?
Hi
>> Certificate Request Processor: The parameter is incorrect. 0x80070057 (WIN32: 87)
What is the command which resulted in this error?