| Unique Visitors |
Many of you will have read my articles regarding changing SSL certificates in vSphere 5 components for custom CA SSL certificates. My motivation for writing them was I felt there was little good information around that would actually help people with this process. It has also traditionally been very difficult and frustrating, not to mention error prone. The good news is that my work has not gone unnoticed with VMware and there is now work underway to improve the public KB’s and documentation that is available to assist customers. Here are some of the VMware KB’s that have been or will be updated. I’m also including links to all of my recent posts regarding SSL certificates, which I will keep updated as I add to it, so you have one index page to visit.
If you want a way to fully manage the certificate lifecycle and replace certs automatically then you’ll want to check out vCert Manager – Changing VMware SSL Certs Made Easy. This will completely automate the SSL certificate process in vSphere environments.
This list below contains links to all of the relevant articles I have posted regarding changing SSL certificates in vSphere 5 and related products. Each link will open in a new window. I have tested the processes outlined in these articles and verified them with customers. This work is being used to update the VMware KB articles.
Updating CA SSL Certificates in vSphere 5.1
Updating CA SSL Certificates in vSphere 5.1 vCenter Virtual Appliance
Changing vCenter Heartbeat to CA SSL Certificates
Updating SSL Certificate in vShield Manager Made Easy
Common Mistakes Implementing CA Signed SSL Certs in vSphere
Best Order for Changing SSL Certs in vSphere Environments
Why change VMware default self-signed SSL Certs?
Virtual Infrastructure Navigator breaks when vCenter SSL Cert Changed
vCenter Server Virtual Appliance – Changing SSL Certs Made Easy
vSphere Web Client SSL Cert not updated after vCenter SSL Cert Changed
The Trouble with CA SSL Certificates and vCenter 5
The Trouble with CA SSL Certificates and ESXi 5
If you have trouble following any of the above articles or you have a request with regard to changing SSL certificates in another VMware product please get in touch via the feedback form on the Author Page. As always your feedback and comments are greatly appreciated. There are still traps that might run into as PKI and SSL Cert generation is particularly complex. So do contact me if you are having a problem with any of the instructions. .
In addition to the KB’s below a new general KB article with regard to changing SSL certificates in vSphere 5 will be published. This KB will bring together the relevant steps and will hopefully cover the full VMware Cloud Infrastructure Management (CIM) suite. As I become aware of new or updated articles I will include them here. So check back regularly to monitor progress.
Thanks to the great work of the VMware team for getting these articles created and updated.
VMware KB 2015387 – Configuring OpenSSL for installation and configuration of CA signed certificates in vSphere environments – Created based on my work
VMware KB 2015421 – Configuring CA Signed certificates for vCenter 5.0 – Created based on my work
VMware KB 2015499 – Configuring CA Signed certificates for ESXi 5.0 – Created based on my work
VMware KB 2009857 – Certificate warning is reported even after replacing vCenter Server 5.0 default SSL certificates with custom SSL certificates – Updated based on my work
VMware KB 1023011 – Replacing SSL certificates for VMware vCenter Update Manager by using the Update Manager Utility
VMware KB 2007824 – After upgrading to vCenter Server 5.0, the vCenter Service Stats and Hardware Status tab cannot be accessed
VMware KB 1013472 – vCenter Server Service Status plug-in cannot be enabled
Generating SSL Certificates for vCenter Operations Manager 5.0 – Erik Bussink
vCenter Operations 5.x vCenter Plugin uses IP instead of DNS hostname – Josh Perkins
Creating a Certificate with Multiple Hostnames – Greg Rowe
vSphere 5 Certificates – Replacing the Default vCenter 5 Server Certificate – Julian Wood
vSphere 5 Certificates – Replacing the Default Update Manager Server Certificate – Julian Wood
Import an OpenSSL CSR into a Windows CA – Christopher Bean
Replace SSL Certificates: Replace vCenter SSL Certificates – Rynardt Spies
Replacing vCenter 4.1 SSL Certificate with Active Directory Issued One – Gavin Adams
Replacing vCenter SSL Certificate with Certificate Issued by Microsoft Certificate Authority – Josh Perkins
—
This post first appeared on the Long White Virtual Clouds blog at longwhiteclouds.com, by Michael Webster +. Copyright © 2012 – IT Solutions 2000 Ltd and Michael Webster +. All rights reserved. Not to be reproduced for commercial purposes without written permission.
This article is a follow up to the one I posted previously regarding The Trouble with CA SSL Certificates and ESXi 5. This article will focus on successfully changing the default VMware SSL certificates on vCenter 5 and vCenter Update Manager hosts with CA signed certificates using a Microsoft CA (it will also work with public and OpenSSL CAs, but I have not tested it yet). One of the things that makes it hard for people to get this right is that like with ESXi 5 there is no one document or source of truth that explains in sufficient detail what the requirements and supported configurations are or how to implement CA signed SSL certificates in vCenter Server. I’m hoping that the information in this article will help and encourage more people to change out the default certs (to improve security), and make the process far more reliable and easier to achieve with vCenter 5. Although not covered here, vCenter Heartbeat is becoming more critical as a component in VMware Infrastructures to provide high availability to vCenter. There is currently no supported way to change the SSL certificates that vCenter Heartbeat uses. There is an unsupported method that I will test and if successful will post once I’ve configured vCenter Heartbeat in my environment.
VMware vCenter CA SSL Certificate Resources
As with my previous article I had to run through a bunch of different resources, some of them the same, some of them different. There are some differences in the way you need to generate certificates between vCenter (and VUM) and the ESXi hosts. The below resources are in no particular order or importance. The all contained important information, which I have distilled into a successful process for this article.
If you want a way to fully manage the certificate lifecycle and replace certs automatically then you’ll want to check out vCert Manager – Changing VMware SSL Certs Made Easy. This will completely automate the SSL certificate process in vSphere environments.
Replacing vCenter Server 4.1 Certificates
Generating Domain Root CA signed certificates for vCenter Server
Creating a Certificate with Multiple Hostnames
vSphere 5 Certificates – Replacing the Default vCenter 5 Server Certificate
vSphere 5 Certificates – Replacing the Default Update Manager Server Certificate
Import an OpenSSL CSR into a Windows CA
Replace SSL Certificates: Replace vCenter SSL Certificates
Replacing vCenter 4.1 SSL Certificate with Active Directory Issued One
Replacing vCenter SSL Certificate with Certificate Issued by Microsoft Certificate Authority
Special thanks to the author of WoodITWork.com, Julian Wood for the excellent articles that he posted that were a great help in putting this together.
Now for the Trouble
With a bit of trial and error you could easily enough replace the vCenter Server certificate with a CA signed certificate with a similar process that I showed you for ESXi. However this won’t do you any good as all of your web services will fail. There is a high likelihood that even if you followed the information in VMware KB 2007824 for vCenter 5 that you would be in no better position. The reason for this is that you would likely not have the correct options in either your CA certificate template, or in your OpenSSL configuration file. There are some slight changes in both of these places that will most likely trip you up. It’s not until you read vSphere 5 Certificates – Replacing the Default vCenter 5 Server Certificate and vSphere 5 Certificates – Replacing the Default Update Manager Server Certificate and then VMware KB 1023011 that you might pick up on the necessary fields that you need to concern yourself with. If you don’t take good care you will find yourself without functioning web services, which is were a lot of the vCenter goodies are. Updating Update Manager is actually on the whole a lot easier than vCenter, provided you have the correct options in your CA Template and also your OpenSSL configuration file. As in my previous article I have invested considerable effort to bring you a solution, that I hope will save you a lot of time and frustration. Also note that just updating the SSL Certificate in the vCenter SSL folder is not good enough. You will also need to replace the SSL Certificate files in the Inventory Service SSL directory and also the SSL directory of any other installed components, such as vSphere Web Client.
Now for the Fix
To ensure that the certificates in vCenter Server actually work and function correctly with the Web Services you actually need to add some additional fields into your CA template and your Certificate Signing Request via the OpenSSL configuration file. The information you need is actually contained in VMware KB 1023011. But honestly this isn’t the first place you’re going to look when trying to change out vCenter Server Certificates as it relates to Update Manager. Why this critical information is not present in the security guide I’m not sure. To save you having to read it all the key bits of configuration for OpenSSL are as follows:
Section [ req ]
encrypt_key = no
Section [ x509 ] in the KB and [ v3_req ] in my example configuration
keyUsage = digitalSignature,keyEncipherment
extendedKeyUsage = serverAuth,clientAuth
I found that the default VMware generated certificate had an additional keyUsage parameter, so in my example I have added nonRepudiation and dataEncipherment, so my config line is as follows:
keyUsage = nonRepudiation, digitalSignature, keyEncipherment, dataEncipherment
You must also include a Subject Alternative Name, which should be the FQDN of the vCenter Server. You can optionally include multiple DNS names in the Subject Alternative Name section, as I have done in my example, to include also the short name of the server. This will ensure that no certificate warning box will be presented if a truly valid server name is used to access it. If you have ever configured certificates for SRM you will know that it uses Subject Alternative Name and Common Name (CN) differently. In the SRM case The Common Name is normally set to “SRM” and must be the same on both sides. The Subject Alternative Name is then set to the FQDN of the SRM Server. This is quite a different use compared to vCenter.
Because we are specifying a Subject Alternative Name for the vCenter Server you must ensure that your CA certificate template includes this option. This options may not be available in all Microsoft CA versions (I have tested 2003 and 2008 successfully).
Although the KB is a good source of information it is still quite easy to get confused by the way it is written. It also doesn’t have all the details, but it’s good that it has more details than many of the other sources of information. For example if you tried issuing the command that includes the -x509 statement you would not have good results if you are sending the request to a CA, as it needs to be base64 encoded.
There is one piece of very important information in the KB that is quite easy to gloss over and it is this:
openssl pkcs12 -in ./mycert.p12 –info #To see the information in pfx file
In my example I actually just ran the command directly against rui.pfx instead of having an additional step. But this step is critical to test the pfx file and ensure it’s integrity and that it can be deciphered using the correct password. If this part of the process fails you know your pfx file is no good and you should not proceed to replace the certificates on the vCenter or Update Manager Servers.
The key pieces of information you need from KB 2007824 are steps 10 through 12, which I have included in my step by step process below.
Step by Step vCenter Server SSL Certificate Replacement using Windows and a Microsoft CA
You will notice that I have repeated some of the steps below from my previous article on ESXi SSL Certificate replacement. This is intentional so that you have all the necessary steps in one place and don’t have to switch back and forth between multiple articles (like I had to do).
You could execute a similar process to the one I’m about to describe using an OpenSSL or Public CA and using the Unix/Linux version of OpenSSL, however this is how I did it successfully in my lab and with my customer. As mentioned in the vSphere 5 Security Guide VMware uses X.509 v3 SSL certificates (base-64 encoded) for encrypting traffic between various components. If you CA has been set to support only SHA512 hash that is fine, it will work, although the VMware documentation doesn’t mention it. The three key files for an vCenter Server are rui.crt, rui.key and rui.pfx.
In order to generate the certificates you’ll need to get a copy of OpenSSL x86 v0.98r or higher, and have access to a Microsoft CA (2003 or higher). The certificates will use a clone of a standard web server request template with Subject Alternative Name added, for my lab I modified the default Web Server Certificate Template to accept up to 15 years for certificates. On the system where you will generate the certificate signing request rui.csr) you will need to ensure you have Microsoft Visual C++ 2008 Redistributable Package (x86) before installing OpenSSL. For the purposes of this process you will use the Microsoft CA Web Pages to submit the certificate request and download the resulting base-64 encoded certificate. You can use the certreq command if you wish also (not covered here). Before applying the certificates to your environment you should ensure that your clients and vCenter server trust your CA, if it’s an AD integrated CA this should be automated, else you may have to pre-trust the Root or Intermediary CA by loading the CA public cert into your clients and vCenter server (not covered in this process).
Don’t forget to test access to all the management tools you use in your environment once the vCenter Certificate is updated. You will likely need to update their connections to vCenter as they will still hold the old SSL thumbprint.
Prerequsites:
Microsoft CA (2003 or above, with Web Server Template with Subject Alternative Name included and configured to your liking)
The CA Template must have the “Allow Key Exchange Only With Key Encryption” option selected in its key usage policy
Microsoft Visual C++ 2008 Redistributable Package (x86) on the system where you will generate the certificate signing request (CSR)
OpenSSL 0.98r or above on the system you will use to generate the CSR
vCenter 5.0
Things to watch out for:
Do not change the password in the OpenSSL configuration from ‘testpassword’, it must remain testpassword.
As stated above you must download the certificate in PEM (Privacy Enhanced Mail) base-64 encoded format.
Process Step by Step:
Now that you’ve updated the vCenter Server and also the Inventory Service Certificates you may need to also update your vSphere Web Client Certificate if it is also on your vCenter Server. The location for the vSphere Web Client SSL Certificate is C:\Program Files\VMware\Infrastructure\vSphere Web Client\DMServer\config\ssl by default. Once you have updated the vSphere Web Client SSL Certificate and restarted the services you will then need to browse to the vSphere Web Client Admin App and re-register vCenter Server to ensure that it is registered with the correct thumbprint. Browse to https://localhost:9443/admin-app.
Up to step 10 the process is almost exactly the same for Update Manager. For Update Manager however you need to copy the new certificate files into <Update Manager Installation Directory>\SSL, after taking a backup of course. The default locations are as follows:
Once the new certificate files are copied into the correct location you need to do the following on the Update Manager Server:
Please let me know if you have any trouble with the above process, and also if it works for you, your comments and feedback are appreciated.
Example OpenSSL Configuration file (openssl.cfg) without most of the normal comments and white space that is included:
# vCenter OpenSSL example configuration file start.
HOME = .
RANDFILE = $ENV::HOME/.rnd
oid_section = new_oids
[ new_oids ]
[ ca ]
default_ca = CA_default # The default ca section
[ CA_default ]
dir = ./demoCA # Where everything is kept
certs = $dir/certs # Where the issued certs are kept
crl_dir = $dir/crl # Where the issued crl are kept
database = $dir/index.txt # database index file.
new_certs_dir = $dir/newcerts # default place for new certs.
certificate = $dir/cacert.pem # The CA certificate
serial = $dir/serial # The current serial number
crlnumber = $dir/crlnumber # the current crl number must be commented out to leave a V1 CRL
crl = $dir/crl.pem # The current CRL
private_key = $dir/private/cakey.pem# The private key
RANDFILE = $dir/private/.rand # private random number file
x509_extensions = usr_cert # The extentions to add to the cert
name_opt = ca_default # Subject Name options
cert_opt = ca_default # Certificate field options
default_days = 5475 # how long to certify for
default_crl_days = 30 # how long before next CRL
default_md = sha512 # which md to use.
preserve = no # keep passed DN ordering
policy = policy_match
[ policy_match ]
countryName = match
stateOrProvinceName = match
organizationName = match
organizationalUnitName = optional
commonName = supplied
emailAddress = optional
[ policy_anything ]
countryName = optional
stateOrProvinceName = optional
localityName = optional
organizationName = optional
organizationalUnitName = optional
commonName = supplied
emailAddress = optional
[ req ]
default_bits = 2048
default_keyfile = privkey.pem
distinguished_name = req_distinguished_name
attributes = req_attributes
x509_extensions = v3_ca # The extentions to add to the self signed cert
input_password = testpassword
output_password = testpassword
encrypt_key = no
prompt = no
string_mask = nombstr
req_extensions = v3_req # The extensions to add to a certificate request
[ req_distinguished_name ] # change these settings for your environment
countryName = NZ
stateOrProvinceName = Auckland
localityName = Auckland
0.organizationName = IT Solutions 2000 Ltd
organizationalUnitName = IT
commonName = vc.homedns.org
emailAddress = admin@yourdomain.com
[ req_attributes ]
[ usr_cert ]
basicConstraints =CA:FALSE
nsComment = “OpenSSL Generated Certificate”
subjectKeyIdentifier =hash
authorityKeyIdentifier =keyid,issuer
[ v3_req ]
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth, clientAuth
subjectAltName = DNS:vc.homedns.org, DNS:vc41.homedns.org, DNS:vc41 #examples only
[ v3_ca ]
subjectKeyIdentifier =hash
authorityKeyIdentifier =keyid:always,issuer:always
basicConstraints = CA:true
[ crl_ext ]
authorityKeyIdentifier =keyid:always,issuer:always
[ proxy_cert_ext ]
basicConstraints =CA:FALSE
nsComment = “OpenSSL Generated Certificate”
subjectKeyIdentifier =hash
authorityKeyIdentifier =keyid,issuer:always
proxyCertInfo =critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
# vCenter OpenSSL example configuration file end.
# vCenter Update Manager OpenSSL example configuration file Start.
HOME = .
RANDFILE = $ENV::HOME/.rnd
oid_section = new_oids
[ new_oids ]
[ ca ]
default_ca = CA_default # The default ca section
[ CA_default ]
dir = ./demoCA # Where everything is kept
certs = $dir/certs # Where the issued certs are kept
crl_dir = $dir/crl # Where the issued crl are kept
database = $dir/index.txt # database index file.
new_certs_dir = $dir/newcerts # default place for new certs.
certificate = $dir/cacert.pem # The CA certificate
serial = $dir/serial # The current serial number
crlnumber = $dir/crlnumber # the current crl number must be commented out to leave a V1 CRL
crl = $dir/crl.pem # The current CRL
private_key = $dir/private/cakey.pem# The private key
RANDFILE = $dir/private/.rand # private random number file
x509_extensions = usr_cert # The extentions to add to the cert
name_opt = ca_default # Subject Name options
cert_opt = ca_default # Certificate field options
default_days = 5475 # how long to certify for
default_crl_days = 30 # how long before next CRL
default_md = sha512 # which md to use.
preserve = no # keep passed DN ordering
policy = policy_match
[ policy_match ]
countryName = match
stateOrProvinceName = match
organizationName = match
organizationalUnitName = optional
commonName = supplied
emailAddress = optional
[ policy_anything ]
countryName = optional
stateOrProvinceName = optional
localityName = optional
organizationName = optional
organizationalUnitName = optional
commonName = supplied
emailAddress = optional
[ req ]
default_bits = 2048
default_keyfile = privkey.pem
distinguished_name = req_distinguished_name
attributes = req_attributes
x509_extensions = v3_ca # The extentions to add to the self signed cert
input_password = testpassword
output_password = testpassword
encrypt_key = no
prompt = no
string_mask = nombstr
req_extensions = v3_req # The extensions to add to a certificate request
[ req_distinguished_name ] # change these settings for your environment
countryName = NZ
stateOrProvinceName = Auckland
localityName = Auckland
0.organizationName = IT Solutions 2000 Ltd
organizationalUnitName = IT
commonName = updmgr.homedns.org
emailAddress = admin@corp.it-solutions.homedns.org
[ req_attributes ]
[ usr_cert ]
basicConstraints =CA:FALSE
nsComment = “OpenSSL Generated Certificate”
subjectKeyIdentifier =hash
authorityKeyIdentifier =keyid,issuer
[ v3_req ]
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth, clientAuth
subjectAltName = DNS:updmgr.homedns.org, DNS:updmgr # examples only
[ v3_ca ]
subjectKeyIdentifier =hash
authorityKeyIdentifier =keyid:always,issuer:always
basicConstraints = CA:true
[ crl_ext ]
authorityKeyIdentifier =keyid:always,issuer:always
[ proxy_cert_ext ]
basicConstraints =CA:FALSE
nsComment = “OpenSSL Generated Certificate”
subjectKeyIdentifier =hash
authorityKeyIdentifier =keyid,issuer:always
proxyCertInfo =critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
# vCenter Update Manager OpenSSL example configuration file End.
—
This post first appeared on the Long White Virtual Clouds blog at longwhiteclouds.com, by Michael Webster +. Copyright © 2012 – IT Solutions 2000 Ltd and Michael Webster +. All rights reserved. Not to be reproduced for commercial purposes without written permission.
For those of you that follow me on Twitter you’ll know that I’ve been having some fun this week with changing out the default VMware generated SSL certificates on a greenfields deployment of vSphere 5 that will be supporting a large public cloud. Changing certificates is nothing new, and in environments that are concerned with security it is common practice. However it has been my experience that changing certificates with ESX(i) and vCenter has always been a bit of a challenge (I have done it on vSphere 4.x before this). It can be very time consuming and error prone, especially if you haven’t done it before. One of the things that makes it hard for people to get this right is that there is no one document or source of truth that explains in sufficient detail what the requirements and supported configurations are or how to implement CA signed ssl certificates in ESX(i) and vCenter Server. This has tripped up many organizations both large and small. I’m hoping that the information in this article will help and encourage more people to change out the default certs (to improve security), and make the process far more reliable and easier to achieve with vSphere 5. This article will focus on successfully changing the default VMware SSL certificates on ESXi 5 hosts with CA signed certificates using a Microsoft CA (it will also work with public and OpenSSL CAs, but I have not tested it yet).
If you want a way to fully manage the certificate lifecycle and replace certs automatically then you’ll want to check out vCert Manager – Changing VMware SSL Certs Made Easy. This will completely automate the SSL certificate process in vSphere environments.
General Information on X.509 Certificates
For anyone that doesn’t know what an X.509 certificate is here are a couple of links that will explain it. The first one is a good human readable explanation and the second is the actual specification published by the Internet Engineering Taskforce (IETF).
Each component in your vSphere Infrastructure uses these X.509 SSL certificates for secure encrypted communications. Each SSL certificate is uniquely generated for each component and ties to the FQDN of the component. So this means every ESXi 5 server has a certificate generated for it based on it’s unique FQDN, as does vCenter, vCenter Update Manager, SRM, vShield Manager and any other components you may be using. This ensures non-repudiation. That is, every system knows that is communicating with the other system that it expects, and it’s not an imposter. This means you can’t just take one cert generated for vCenter for example and apply it to all of your hosts. I have not tested using wildcard certificates (*.domain) with vSphere 5, but in earlier versions some components didn’t support them. From a security standpoint it is much better to have a single SSL cert tied to a single host by FQDN.
VMware CA SSL Certificate Resources
While I was working through generating and applying the certificates in the environment I was working in over the last week I ran through all of these resources below. All have some good information. But none is a complete end to end guide on how to generate and apply the certificates that will work reliably with vSphere 5 (which is the reason I had to review them all). The reason why I went through some of the older material on this is because it is largely still relevant. But there are some subtle changes to the way that vSphere 5 works that you need to know about to be successful. You will also notice as you read through all of these documents and kb articles that there is a lack of consistency.
How to use CA certificate to replace VMware certificate on ESX(i) 4 and vCenter
Replacing vCenter Server 4.1 Certificates
Generating Domain Root CA signed certificates for vCenter Server
The Trouble with CA SSL Certificates and vCenter 5
Import an OpenSSL CSR into a Windows CA
Now for the Trouble
You’ll notice in the above list of resources are a couple of VMware KB articles referring to issued with the new VMware HA after you change the SSL certificates for CA signed certificates, or after an upgrade where it was previously done. This is the problem that I ran into both in my lab and also in my customers environment (both are new builds with CA SSL certificates). However following the steps in the KB was not successful.
The reason these errors occur in the first place is that FDM, which is the New VMware HA, enforces SSL certificate verification for communication whenever a host is configured for VMware HA. So you need to make sure that you also have vCenter set to verify host certificates (vSphere Client, Menu Bar – Administration > vCenter Server Settings > SSL Settings > tick vCenter requires verified host SSL certificates, which is the default setting), otherwise you won’t be able to use HA. This is fantastic for security, but unfortunately there is a bug (is expected to be fixed in vSphere 5.0 U1) that means the new thumbprints on hosts that have had their SSL certificates changed don’t end up in the vCenter database (not good). As a result when you try and configure VMware HA after an upgrade where the certs have been changed, or straight after you’ve changed them in a new environment, VMware HA configuration will fail.
You might see an error message such as this:
And also see something like this, an HA election that never ends:
You might also see this in your fdm.log in /var/log on your ESXi Host (related to the above picture):
Feb 3 23:38:37 vmserver12 Fdm: [7D620B90 info ‘Cluster’ opID=SWI-6cc6b9b8] Change state to Startup:0
Feb 3 23:38:38 vmserver12 Fdm: [7D620B90 info ‘Cluster’ opID=SWI-6cc6b9b8] Change state to SlaveConnecting:146874673025
Feb 3 23:38:38 vmserver12 Fdm: [7D620B90 info ‘Election’ opID=SWI-6cc6b9b8] Slave to host @ 192.168.3.222
Feb 3 23:38:42 vmserver12 Fdm: [7D59EB90 info ‘Cluster’ opID=SWI-f5f44234] [ClusterManagerImpl::MainLoop] curState 4 lastState 3
Feb 3 23:38:44 vmserver12 Fdm: [7D620B90 info ‘Cluster’ opID=SWI-6cc6b9b8] Change state to Slave:146874673025
Feb 3 23:38:56 vmserver12 Fdm: [7D7E7B90 info ‘Election’] MasterShutdown
Feb 3 23:38:59 vmserver12 Fdm: [7D6E3B90 info ‘Message’] Destroying connection
Feb 3 23:39:00 vmserver12 Fdm: [7D620B90 info ‘Cluster’ opID=SWI-6cc6b9b8] Change state to SlaveConnecting:146874673025
Feb 3 23:39:04 vmserver12 Fdm: [7D59EB90 info ‘Cluster’ opID=SWI-f5f44234] [ClusterManagerImpl::MainLoop] curState 3 lastState 1
Feb 3 23:39:04 vmserver12 Fdm: [7D59EB90 info ‘Cluster’ opID=SWI-f5f44234] [ClusterManagerImpl::MainLoop] curState 4 lastState 3
Feb 3 23:39:24 vmserver12 Fdm: [7D5DFB90 warning ‘Libs’ opID=SWI-f67a1d5c] SSL_VerifyX509: Certificate verification is disabled, so connection will proceed despite the error
Feb 3 23:39:24 vmserver12 Fdm: [7D5DFB90 warning ‘Libs’ opID=SWI-f67a1d5c] SSL_VerifyX509: Certificate verification is disabled, so connection will proceed despite the error
Feb 3 23:39:44 vmserver12 Fdm: [7D620B90 info ‘Election’ opID=SWI-6cc6b9b8] Slave to host @ 192.168.3.222
Feb 3 23:39:46 vmserver12 Fdm: [7D6E3B90 warning ‘Libs’ opID=SWI-a257b9a0] SSL_VerifyX509: Certificate verification is disabled, so connection will proceed despite the error
Feb 3 23:39:58 vmserver12 Fdm: [7D620B90 info ‘Election’ opID=SWI-6cc6b9b8] Slave to host @ 192.168.3.222
Feb 3 23:40:13 vmserver12 Fdm: [7D620B90 info ‘Cluster’ opID=SWI-6cc6b9b8] Change state to Startup:0
Feb 3 23:40:21 vmserver12 Fdm: [7D620B90 info ‘Cluster’ opID=SWI-6cc6b9b8] Change state to Startup:0
Feb 3 23:40:38 vmserver12 Fdm: [7D59EB90 verbose ‘Cluster’ opID=SWI-f5f44234] [ClusterManagerImpl::CheckElectionState] Transitioned from Startup to SlaveConnecting
Feb 3 23:40:40 vmserver12 Fdm: [7D661B90 warning ‘Libs’ opID=SWI-15378378] SSL_VerifyX509: Certificate verification is disabled, so connection will proceed despite the error
Feb 3 23:40:40 vmserver12 Fdm: [7D661B90 warning ‘Libs’ opID=SWI-15378378] SSL_VerifyX509: Certificate verification is disabled, so connection will proceed despite the error
Feb 3 23:40:44 vmserver12 Fdm: [7D620B90 info ‘Election’ opID=SWI-6cc6b9b8] [ClusterElection::ChangeState] SlaveConnecting => Slave : SlaveConnectingStateFunc
Feb 3 23:40:50 vmserver12 Fdm: [7D765B90 warning ‘Libs’ opID=SWI-16099a2a] SSL_VerifyX509: Certificate verification is disabled, so connection will proceed despite the error
Feb 3 23:40:54 vmserver12 Fdm: [7D6A2B90 info ‘Election’] MasterShutdown
Now for the Fix
To resolve this situation you need to add one additional step to the process that is outlined in After upgrading to vSphere 5, you see the HA error: vSphere HA Cannot be configured on this host because its SSL thumbprint has not been verified. The step is this:
After changing the certificates, restarting the management agents on the host, and existing maintenance mode, wait for HA to configure and fail. Once the exit maintenance mode task is completed disconnect and reconnect the host to vCenter.
Now you can use either of the methods mentioned in KB 2006210 to fix the SSL certificate thumbprint problem. My preference is to use the pearl script via the vSphere API as this doesn’t require vCenter to be shut down. Once the fix has been applied as per the KB you will once again need to reconfigure VMware HA on the host. You will now notice that it is functioning correctly. Now for the step by step process I used.
Step by Step ESXi Host SSL Certificate Replacement using Windows and a Microsoft CA
You could execute a similar process to the one I’m about to describe using an OpenSSL or Public CA and using the Unix/Linux version of OpenSSL, however this is how I did it successfully in my lab and with my customer. As mentioned in the vSphere 5 Security Guide VMware uses X.509 v3 SSL certificates (base-64 encoded) for encrypting traffic between various components. If you CA has been set to support only SHA512 hash that is fine, it will work, although the VMware documentation doesn’t mention it. The two key files for an ESXi host are rui.crt and rui.key.
In order to generate the certificates you’ll need to get a copy of OpenSSL x86 v0.98r or higher, and have access to a Microsoft CA (2000 or higher). The certificates will use a standard web server request template. On the system where you will generate the certificate signing request (rui.csr) you will need to ensure you have Microsoft Visual C++ 2008 Redistributable Package (x86) before installing OpenSSL. For the purposes of this process you will use the Microsoft CA Web Pages to submit the certificate request and download the resulting base-64 encoded certificate. You can use the certreq command if you wish also (not covered here). Ensure you have a vSphere Management Appliance v5 (vMA) deployed in your environment, you will use this to execute the HostReconnet.pl script to save you having to shut down vCenter during the process (hopefully won’t be needed when vSphere 5.0 U1 is available). Before applying the certificates to your environment you should ensure that your clients and vCenter server trust your CA, if it’s an AD integrated CA this should be automated, else you may have to pre-trust the Root or Intermediary CA by loading the CA public cert into your clients and vCenter server (not covered in this process).
Prerequsites:
Microsoft CA (2000 or above, with Web Server Template configured to your liking)
Microsoft Visual C++ 2008 Redistributable Package (x86) on the system where you will generate the certificate signing request (CSR)
OpenSSL 0.98r or above on the system you will use to generate the CSR
vSphere Management Assistant v5 (vMA)
FinalHostReconnect.rar, which contains HostReconnect.pl and can be obtained from VMware KB 2006210
Putty or other SSH client
WinSCP or other SFTP / SCP client
vCenter 5.0
ESXi 5.0
Assumes that the ESXi 5.0 hosts are in a cluster with VMware HA enabled.
Process Step by Step:
Please let me know if you have any trouble with the above process, and also if it works for you, your comments and feedback are appreciated. Note: Steps 16, 18 – 23 are not be needed when vSphere 5.0 U1 or later is used.
Example OpenSSL Configuration file (openssl.cfg) without most of the normal comments and white space that is included:
#OpenSSL Configuration Start
HOME = .
RANDFILE = $ENV::HOME/.rnd
oid_section = new_oids
[ new_oids ]
####################################################################
[ ca ]
default_ca = CA_default # The default ca section
####################################################################
[ CA_default ]
dir = ./demoCA # Where everything is kept
certs = $dir/certs # Where the issued certs are kept
crl_dir = $dir/crl # Where the issued crl are kept
database = $dir/index.txt # database index file.
#unique_subject = no # Set to ‘no’ to allow creation of
# several ctificates with same subject.
new_certs_dir = $dir/newcerts # default place for new certs.
certificate = $dir/cacert.pem # The CA certificate
serial = $dir/serial # The current serial number
crlnumber = $dir/crlnumber # the current crl number
# must be commented out to leave a V1 CRL
crl = $dir/crl.pem # The current CRL
private_key = $dir/private/cakey.pem# The private key
RANDFILE = $dir/private/.rand # private random number file
x509_extensions = usr_cert # The extentions to add to the cert
name_opt = ca_default # Subject Name options
cert_opt = ca_default # Certificate field options
default_days = 5475 # how long to certify for (e.g. 15 years)
default_crl_days= 30 # how long before next CRL
default_md = sha512 # which md to use.
preserve = no # keep passed DN ordering
policy = policy_match
# For the CA policy
[ policy_match ]
countryName = match
stateOrProvinceName = match
organizationName = match
organizationalUnitName = optional
commonName = supplied
emailAddress = optional
[ policy_anything ]
countryName = optional
stateOrProvinceName = optional
localityName = optional
organizationName = optional
organizationalUnitName = optional
commonName = supplied
emailAddress = optional
[ req ]
default_bits = 2048
default_keyfile = privkey.pem
distinguished_name = req_distinguished_name
attributes = req_attributes
x509_extensions = v3_ca # The extentions to add to the self signed cert
input_password = testpassword
output_password = testpassword
string_mask = nombstr
[ req_distinguished_name ]
countryName = Country Name (2 letter code)
countryName_default = NZ
countryName_min = 2
countryName_max = 2
stateOrProvinceName = State or Province Name (full name)
stateOrProvinceName_default = Auckland
localityName = Locality Name (eg, city)
localityName_default = Auckland
0.organizationName = Organization Name (eg, company)
0.organizationName_default = IT Solutions 2000 Ltd
organizationalUnitName = Organizational Unit Name (eg, section)
organizationalUnitName_default = IT
commonName = Common Name (e.g. server FQDN or YOUR name)
commonName_max = 64
emailAddress = Email Address
emailAddress_max = 64
emailAddress_default = admin@yourdomain.com
[ req_attributes ]
challengePassword = A challenge password
challengePassword_min = 4
challengePassword_max = 20
unstructuredName = An optional company name
[ usr_cert ]
basicConstraints=CA:FALSE
nsComment = “OpenSSL Generated Certificate”
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid,issuer
[ v3_req ]
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth, clientAuth
[ v3_ca ]
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer:always
basicConstraints = CA:true
[ crl_ext ]
authorityKeyIdentifier=keyid:always,issuer:always
[ proxy_cert_ext ]
basicConstraints=CA:FALSE
nsComment = “OpenSSL Generated Certificate”
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid,issuer:always
proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo
#OpenSSL Configuration End
This post first appeared on the Long White Virtual Clouds blog at longwhiteclouds.com, by Michael Webster +. Copyright © 2012 – IT Solutions 2000 Ltd and Michael Webster +. All rights reserved. Not to be reproduced for commercial purposes without written permission.