<div dir="ltr">Thanks for the response.<div><br></div><div>My current chain is as follows:</div><div><br></div><div>caroot -> child-ca1 -> server cert</div><div><br></div><div>My cacert.pem file has both the caroot and the child-ca1 certs. I have recompiled libvirt on my machine with some extra debug statements and verified that both the caroot cert and the child-ca1 certs are being loaded. But when I try to connect the caroot and child-ca1 certs only appear under the "<span style="font-family:arial,sans-serif;font-size:13px">Acceptable client certificate CA names" not the certificate chain. The error I get on the client when connecting is that the server identity could not be verified since the server isn't presenting the entire CA chain just its own cert.</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Tue, Apr 22, 2014 at 4:37 AM, Daniel P. Berrange <span dir="ltr"><<a href="mailto:berrange@redhat.com" target="_blank">berrange@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Mon, Apr 21, 2014 at 04:51:00PM -0600, Nathaniel Cook wrote:<br>
> I have been trying to get set of libvirtd system up and running.  My PKI<br>
> infrastructure involves a root CA and several intermediate CAs. I am trying<br>
> to get the machines to trust each other across the different intermediate<br>
> CAs.<br>
><br>
> This is what I have so far:<br>
><br>
> Libvirtd is starting and listening on tls port 16514 I have configured<br>
> client/server certs/keys and it seems to be using all of these correctly.<br>
><br>
> I have also configured the cacert.pem file (which has two certs in the<br>
> chain). I have confirmed (recompiling with various debug statements) that<br>
> the gnutls libraries are successfully loading both certs from the<br>
> cacert.pem file.<br>
><br>
> When I try to connect with openssl s_client -connect <host>:16514 I get<br>
> something similar to this:<br>
> ---<br>
> Certificate chain<br>
>  0 s:/CN=<a href="http://kvm999.example.com" target="_blank">kvm999.example.com</a><br>
>    i:/C=US/ST=Utah/O=Qualtrics/OU=SRE/CN=<a href="http://intca1.example.com" target="_blank">intca1.example.com</a><br>
> ---<br>
> Server certificate<br>
> -----BEGIN CERTIFICATE-----<br>
> ... omitted for brevity<br>
> -----END CERTIFICATE-----<br>
> subject=/CN=<a href="http://kvm999.example.com" target="_blank">kvm999.example.com</a><br>
> issuer=/C=US/ST=Utah/O=Qualtrics/OU=SRE/CN=<a href="http://intca1.example.com" target="_blank">intca1.example.com</a><br>
> ---<br>
> Acceptable client certificate CA names<br>
> /C=US/ST=Utah/O=Qualtrics/OU=SRE/CN=<a href="http://intca1.example.com" target="_blank">intca1.example.com</a><br>
> /C=US/ST=Utah/O=Qualtrics/OU=SRE/CN=<a href="http://rootca.example.com" target="_blank">rootca.example.com</a><br>
> ---<br>
><br>
><br>
> The "Server certificate" and "Acceptable client certificate CA names" look<br>
> right. The problem is that the certificate chain is just the single server<br>
> cert and does not include the intermediate cert or root cert. As a result<br>
> clients from other intermediate CAs fail to verify the libvirtd process.<br>
<br>
</div></div>If you have a chain of CAs<br>
<br>
   caroot -> child-ca1 -> child-ca2 -> server cert<br>
<br>
Then the cacert.pem file you create on the clients / server must<br>
include the certs for caroot, child-ca1 and child-ca2 all in one<br>
file. You can basically just concatenate the .pem files for all<br>
the CAs into one file and gnutls will load all the CA cert blocks<br>
it finds in that file<br>
<br>
<br>
Regards,<br>
Daniel<br>
<span class="HOEnZb"><font color="#888888">--<br>
|: <a href="http://berrange.com" target="_blank">http://berrange.com</a>      -o-    <a href="http://www.flickr.com/photos/dberrange/" target="_blank">http://www.flickr.com/photos/dberrange/</a> :|<br>
|: <a href="http://libvirt.org" target="_blank">http://libvirt.org</a>              -o-             <a href="http://virt-manager.org" target="_blank">http://virt-manager.org</a> :|<br>
|: <a href="http://autobuild.org" target="_blank">http://autobuild.org</a>       -o-         <a href="http://search.cpan.org/~danberr/" target="_blank">http://search.cpan.org/~danberr/</a> :|<br>
|: <a href="http://entangle-photo.org" target="_blank">http://entangle-photo.org</a>       -o-       <a href="http://live.gnome.org/gtk-vnc" target="_blank">http://live.gnome.org/gtk-vnc</a> :|<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>-Nathaniel Cook
</div>