I checked the configuration of the Puppet virtual site. It all looked OK. I then turned to openssl (https://www.openssl.org/docs/apps/x509.html) to check the certificates. I used the following (substituting the certificate file for cert.pem) to print out the server and CA certificates used in the configuration:
openssl x509 -in cert.pem -noout -text
I decided to have a look at the certificates I got if I connected to the server. Again openssl is your friend (http://stackoverflow.com/questions/7885785/using-openssl-to-get-the-certificate-from-a-server). I ran the following with output to separate files for the WEBrick and Apache servers.
This gave me 2 files each with 2 certificates in it. The first certificate is the server certificate and the second is the CA certificate. A brief inspection of the files showed that the first certificate was different whilst the second the same: ie the server certificates differed but the CA certificates were the same. I confirmed this further by splitting each certificate out to a separate file and using openssl to print text representations as per check on configured certificates above.openssl s_client -showcerts -connect ecm-rhl-001:8140 </dev/null >WEBrick.certsopenssl s_client -showcerts -connect ecm-rhl-001:8140 </dev/null >Apache.certs
This allowed me to check that the certificate and private keys matched. It also gave me a quick way to check what keys the certificates that I retrieved from the servers matched. All checked out OK. I still could not locate the illusive certificate that was being returned by the Apache server. I checked a number of possible keys and
So I went back to look at the Apache configuration and checked all of them for 'SSLCertificateFile' using grep. This showed the that "SSL Configuration" had a certificate defined in it by default. A quick check using the previous Openssl commands showed that it matched the one returned by the Apache server. A few comments to remove the unwanted site from the Apache configuration and everything was working again.
I've installed ssl on a number of Apache servers (debian package, ubuntu package & compiled from source) over the last 15 years or so and this is the first time the ssl configuration has included a "live" ssl virtual host definition.
Tom