[libvirt] VMware support and libcurl on rhel-u1

Shahar Klein shaharklein at yahoo.com
Tue Jul 28 09:22:25 UTC 2009


doesn't work for me(with curl 7.15 and ESX4i)

[root at rain8 libvirt]# virsh -c esx://172.30.8.63?no_verify=1
Enter username for 172.30.8.63 [root]:
Enter root password for 172.30.8.63:
error: internal error curl_easy_perform() returned an error: SSL peer certificate was not ok (51)
error: failed to connect to the hypervisor

I had to set(unset) CURLOPT_SSL_VERIFYHOST in order to connect:
--- a/src/esx/esx_vi.c
+++ b/src/esx/esx_vi.c
@@ -239,6 +239,7 @@ esxVI_Context_Connect(virConnectPtr conn, esxVI_Context *ctx, const char *url,
     curl_easy_setopt(ctx->curl_handle, CURLOPT_HEADER, 0);
     curl_easy_setopt(ctx->curl_handle, CURLOPT_FOLLOWLOCATION, 1);
     curl_easy_setopt(ctx->curl_handle, CURLOPT_SSL_VERIFYPEER, noVerify ? 0 : 1);
+    curl_easy_setopt(ctx->curl_handle, CURLOPT_SSL_VERIFYHOST, noVerify ? 0 : 1);
     curl_easy_setopt(ctx->curl_handle, CURLOPT_COOKIEFILE, "");
     curl_easy_setopt(ctx->curl_handle, CURLOPT_HTTPHEADER, ctx->curl_headers);
     curl_easy_setopt(ctx->curl_handle, CURLOPT_WRITEFUNCTION,
----

[root at rain8 libvirt]# virsh -c esx://172.30.8.63?no_verify=1
Enter username for 172.30.8.63 [root]:
Enter root password for 172.30.8.63:
Welcome to virsh, the virtualization interactive terminal. Type:  'help' for help with commands 'quit' to quit virsh # list Id Name                 State
---------------------------------- 16 rh53                 running
160 Rhel-server 5_3      running virsh # 




________________________________
From: Matthias Bolte <matthias.bolte at googlemail.com>
To: Shahar Klein <shaharklein at yahoo.com>
Cc: Tom Hughes <tom at compton.nu>; libvir-list at redhat.com
Sent: Monday, July 27, 2009 3:41:16 PM
Subject: Re: [libvirt] VMware support and libcurl on rhel-u1

2009/7/27 Shahar Klein <shaharklein at yahoo.com>:
> apperantly I needed to unset CURLOPT_SSL_VERIFYHOST as well
> patched that and it is working now
> 10x
> Shahar

With latest git HEAD you should be able to connect using

virsh -c esx://rain3?no_verify=1

Regards,
  Matthias



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20090728/fcce31a7/attachment-0001.htm>


More information about the libvir-list mailing list