<div dir="ltr">Hi guys,<br clear="all"><div><div class="gmail_signature"><br></div><div class="gmail_signature">I met a problem when I use tls to connect libvirt. </div><div class="gmail_signature">When I set the CN in <a href="http://client.info">client.info</a>, <a href="http://server.info">server.info</a> as hostname(FDQN), the tls check will fail with ip; and vice versa, when set CN as ip address, the tls check will fail with hostname. Only use what we set in can succeed. If this is expected? or I there was some issue in my env. or setup steps?</div><div class="gmail_signature"><br></div><div class="gmail_signature"><br></div><div class="gmail_signature">1. set tls env with hostname, then it will fail to check with ip</div><div class="gmail_signature"><br></div><div class="gmail_signature"><div class="gmail_signature"># virsh -c qemu+tls://<a href="http://192.168.122.4/system">192.168.122.4/system</a></div><div class="gmail_signature">2017-12-06 13:24:52.346+0000: 3954: info : libvirt version: x.x.x, package: 4.el7 (Red Hat, Inc. <<a href="http://bugzilla.redhat.com/bugzilla">http://bugzilla.redhat.com/bugzilla</a>>, 2017-11-30-07:57:27, <a href="http://x.x.x.redhat.com">x.x.x.redhat.com</a>)</div><div class="gmail_signature">2017-12-06 13:24:52.346+0000: 3954: info : hostname: <a href="http://work.englab.cn">work.englab.cn</a></div><div class="gmail_signature">2017-12-06 13:24:52.346+0000: 3954: warning : virNetTLSContextCheckCertificate:1125 : Certificate check failed Certificate [session] owner does not match the hostname 192.168.122.4</div><div class="gmail_signature">error: failed to connect to the hypervisor</div><div class="gmail_signature">error: authentication failed: Failed to verify peer's certificate</div><div><br></div><div>2. use the hostname as what we set can succeed.</div><div><br></div><div><div># virsh -c qemu+tls://<a href="http://test.englab.cn/system">test.englab.cn/system</a></div><div>Welcome to virsh, the virtualization interactive terminal.</div><div><br></div><div>Type:  'help' for help with commands</div><div>       'quit' to quit</div><div><br></div><div>virsh # </div></div><div><br></div><div><br></div><div><div># ping <a href="http://test.englab.cn">test.englab.cn</a></div><div>PING <a href="http://test.englab.cn">test.englab.cn</a> (192.168.122.4) 56(84) bytes of data.</div><div>64 bytes from <a href="http://test.englab.cn">test.englab.cn</a> (192.168.122.4): icmp_seq=1 ttl=64 time=0.235 ms</div><div>64 bytes from <a href="http://test.englab.cn">test.englab.cn</a> (192.168.122.4): icmp_seq=2 ttl=64 time=0.204 ms</div></div><div>...</div><div><br></div><div class="gmail_signature"><br></div><br>-------<br>Best Regards,<br>Yalan Zhang<br></div></div>
</div>