<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: HP SDN VAN Controller - V2.0.0.4253 - Token Generation using LIB CURL in Software Defined Networking</title>
    <link>https://community.hpe.com/t5/software-defined-networking/hp-sdn-van-controller-v2-0-0-4253-token-generation-using-lib/m-p/6679785#M600</link>
    <description>&lt;P&gt;Hi SDN Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not able to get the token, as i am getting the ssl error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the error I am getting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;* Hostname was NOT found in DNS cache&lt;BR /&gt;* Trying 128.88.150.151...&lt;BR /&gt;* Connected to 128.88.150.151 (128.88.150.151) port 8443 (#0)&lt;BR /&gt;* unable to use client certificate (no key found or wrong pass phrase?)&lt;BR /&gt;* Closing connection 0&lt;BR /&gt;curl_easy_perform() failed: Problem with the local SSL certificate&lt;/P&gt;&lt;P&gt;Process returned 0 (0x0) execution time : 2.234 s&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;some time ceft error, and some time ssl connection error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the code &amp;nbsp;I am using, in a c lang,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;curl_easy_setopt(curl, CURLOPT_PROXY, "");&lt;BR /&gt;curl_easy_setopt(curl, CURLOPT_SSLKEY, "cacert.pem");&lt;BR /&gt;curl_easy_setopt(curl,CURLOPT_SSLKEYTYPE, "PEM");&lt;BR /&gt;curl_easy_setopt(curl, CURLOPT_CAINFO, "cacert.pem");&lt;BR /&gt;curl_easy_setopt(curl, CURLOPT_SSLCERT, "cacert.pem");&lt;/P&gt;&lt;P&gt;/* -X POST */&lt;BR /&gt;curl_easy_setopt(curl, CURLOPT_POST, 1L);&lt;BR /&gt;curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "{\"login\":{\"user\": \"sdn\", \"password\":\"skyline\" ,\"domain\":\"sdn\"}}");//"{ \"login\": { \"user\": \"sdn\", \"password\": \"skyline\",\"domain\":\"sdn\" }}");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried with ca-bundle.cert in place of pem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using or writing an application in windows using curl and C.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Request you to please advice me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Satish K&lt;/P&gt;</description>
    <pubDate>Mon, 01 Dec 2014 10:09:19 GMT</pubDate>
    <dc:creator>SatishK</dc:creator>
    <dc:date>2014-12-01T10:09:19Z</dc:date>
    <item>
      <title>HP SDN VAN Controller - V2.0.0.4253 - Token Generation using LIB CURL</title>
      <link>https://community.hpe.com/t5/software-defined-networking/hp-sdn-van-controller-v2-0-0-4253-token-generation-using-lib/m-p/6531974#M342</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/********************************************************
 Purpoese : Program to generate the token for HP VAN controller
 Library  : libcurl is used
 Usage    : gcc -o token hp_forum_token.c -lcurl

 Reference Command :
     curl -k -X POST  "&lt;A target="_blank" href="https://127.0.0.1:8443/sdn/v2.0/auth&amp;quot;"&gt;https://127.0.0.1:8443/sdn/v2.0/auth"&lt;/A&gt; -d '{"login":{"user":"sdn","password":"skyline"}}' -H "Content-Type:application/json"

*/

#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;curl/curl.h&amp;gt;
#include&amp;lt;string.h&amp;gt;
#include&amp;lt;stdlib.h&amp;gt;

int main(void)
{
  CURL *curl;
  CURLcode res;

  curl_global_init(CURL_GLOBAL_DEFAULT);

  curl = curl_easy_init();
  if(curl) {

    struct curl_slist *slist = NULL;
    /* -H Header */
    slist = curl_slist_append(slist, "Content-type: application/json");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, slist);

    /* URL */
    curl_easy_setopt(curl, CURLOPT_URL, "&lt;A target="_blank" href="https://127.0.0.1:8443/sdn/v2.0/auth&amp;quot;);"&gt;https://127.0.0.1:8443/sdn/v2.0/auth");&lt;/A&gt;

    /*  -X POST */
    curl_easy_setopt(curl, CURLOPT_POST, 1L);
    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "user=sdn&amp;amp;password=skyline&amp;amp;domain=sdn");

 /* -v option */
    curl_easy_setopt(curl,CURLOPT_VERBOSE,1L);

    /* -k option */
    curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
    curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);


    /* Perform the request, res will get the return code */
    res = curl_easy_perform(curl);
    /* Check for errors */
    if(res != CURLE_OK)
      fprintf(stderr, "curl_easy_perform() failed: %s\n",
              curl_easy_strerror(res));

    /* always cleanup */
    curl_slist_free_all(slist);
    curl_easy_cleanup(curl);
  }

  curl_global_cleanup();

  return 0;
}

&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I installed the HP SDN VAN controller software. I can able to successfuly generate the token using the following curl command as mentioned in HP documentation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"curl -k -X POST&amp;nbsp; "&lt;A target="_blank" href="https://127.0.0.1:8443/sdn/v2.0/auth"&gt;https://127.0.0.1:8443/sdn/v2.0/auth&lt;/A&gt;" -d '{"login":{"user":"sdn","password":"skyline"}}' -H "Content-Type:application/json"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As a part of application development using HP SDN VAN Controller, I used libcurl library utility to generate the token. I am facing issues as I could not able to generate the token. I followed all the option setting as mentioned in above curl command. I am not sure whether any other options needs to given to generate the token. The following is the error generated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Refer the code as shown above for reference. Any help is appreciated. Thanks for understanding&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;================ Error Message ============================&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;* About to connect() to 127.0.0.1 port 8443 (#0)&lt;BR /&gt;*&amp;nbsp;&amp;nbsp; Trying 127.0.0.1... * connected&lt;BR /&gt;* successfully set certificate verify locations:&lt;BR /&gt;*&amp;nbsp;&amp;nbsp; CAfile: none&lt;BR /&gt;&amp;nbsp; CApath: /etc/ssl/certs&lt;BR /&gt;* SSL connection using DHE-DSS-AES256-SHA&lt;BR /&gt;* Server certificate:&lt;BR /&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; subject: C=CA; ST=CA; L=Palo Alto; O=HP; OU=HP SDN Controller; CN=127.0.1.1&lt;BR /&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; start date: 2014-04-15 14:22:31 GMT&lt;BR /&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; expire date: 2014-07-14 14:22:31 GMT&lt;BR /&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; issuer: C=CA; ST=CA; L=Palo Alto; O=HP; OU=HP SDN Controller; CN=127.0.1.1&lt;BR /&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SSL certificate verify result: self signed certificate (18), continuing anyway.&lt;BR /&gt;&amp;gt; POST /sdn/v2.0/auth HTTP/1.1&lt;BR /&gt;Host: 127.0.0.1:8443&lt;BR /&gt;Accept: */*&lt;BR /&gt;Content-type: application/json&lt;BR /&gt;Content-Length: 36&lt;/P&gt;&lt;P&gt;* upload completely sent off: 36out of 36 bytes&lt;BR /&gt;&amp;lt; HTTP/1.1 400 Bad Request&lt;BR /&gt;&amp;lt; Server: Apache-Coyote/1.1&lt;BR /&gt;&amp;lt; X-FRAME-OPTIONS: deny&lt;BR /&gt;&amp;lt; Access-Control-Allow-Origin: *&lt;BR /&gt;&amp;lt; Access-Control-Allow-Methods: GET, POST, PUT, HEAD, PATCH&lt;BR /&gt;&amp;lt; Access-Control-Allow-Headers: Content-Type, Accept, X-Auth-Token&lt;BR /&gt;&amp;lt; Content-Type: application/json&lt;BR /&gt;&amp;lt; Transfer-Encoding: chunked&lt;BR /&gt;&amp;lt; Date: Tue, 08 Jul 2014 20:00:50 GMT&lt;BR /&gt;&amp;lt; Connection: close&lt;BR /&gt;&amp;lt;&lt;BR /&gt;* Closing connection #0&lt;BR /&gt;{"error":"java.lang.IllegalArgumentException","message":"Unable to parse login data&amp;amp;colon; Unexpected character ('u' (code 117)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: &lt;A target="_blank" href="mailto:java.io.StringReader@34e34720"&gt;java.io.StringReader@34e34720&lt;/A&gt;; line: 1, column:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;==================================================================================&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jul 2014 06:49:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/software-defined-networking/hp-sdn-van-controller-v2-0-0-4253-token-generation-using-lib/m-p/6531974#M342</guid>
      <dc:creator>kaarthik</dc:creator>
      <dc:date>2014-07-08T06:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: HP SDN VAN Controller - V2.0.0.4253 - Token Generation using LIB CURL</title>
      <link>https://community.hpe.com/t5/software-defined-networking/hp-sdn-van-controller-v2-0-0-4253-token-generation-using-lib/m-p/6545494#M347</link>
      <description>&lt;P&gt;Hello kaarthik,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please modify below line&lt;/P&gt;&lt;P&gt;curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "user=sdn&amp;amp;password=skyline&amp;amp;domain=sdn");&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;as&lt;/P&gt;&lt;P&gt;&amp;nbsp;curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "{ \"login\": { \"user\": \"sdn\", \"password\": \"skyline\",\"domain\":\"sdn\" }}");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and try again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let us know if this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;HP SDN Team&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jul 2014 09:03:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/software-defined-networking/hp-sdn-van-controller-v2-0-0-4253-token-generation-using-lib/m-p/6545494#M347</guid>
      <dc:creator>sdnindia</dc:creator>
      <dc:date>2014-07-18T09:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: HP SDN VAN Controller - V2.0.0.4253 - Token Generation using LIB CURL</title>
      <link>https://community.hpe.com/t5/software-defined-networking/hp-sdn-van-controller-v2-0-0-4253-token-generation-using-lib/m-p/6679785#M600</link>
      <description>&lt;P&gt;Hi SDN Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not able to get the token, as i am getting the ssl error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the error I am getting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;* Hostname was NOT found in DNS cache&lt;BR /&gt;* Trying 128.88.150.151...&lt;BR /&gt;* Connected to 128.88.150.151 (128.88.150.151) port 8443 (#0)&lt;BR /&gt;* unable to use client certificate (no key found or wrong pass phrase?)&lt;BR /&gt;* Closing connection 0&lt;BR /&gt;curl_easy_perform() failed: Problem with the local SSL certificate&lt;/P&gt;&lt;P&gt;Process returned 0 (0x0) execution time : 2.234 s&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;some time ceft error, and some time ssl connection error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the code &amp;nbsp;I am using, in a c lang,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;curl_easy_setopt(curl, CURLOPT_PROXY, "");&lt;BR /&gt;curl_easy_setopt(curl, CURLOPT_SSLKEY, "cacert.pem");&lt;BR /&gt;curl_easy_setopt(curl,CURLOPT_SSLKEYTYPE, "PEM");&lt;BR /&gt;curl_easy_setopt(curl, CURLOPT_CAINFO, "cacert.pem");&lt;BR /&gt;curl_easy_setopt(curl, CURLOPT_SSLCERT, "cacert.pem");&lt;/P&gt;&lt;P&gt;/* -X POST */&lt;BR /&gt;curl_easy_setopt(curl, CURLOPT_POST, 1L);&lt;BR /&gt;curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "{\"login\":{\"user\": \"sdn\", \"password\":\"skyline\" ,\"domain\":\"sdn\"}}");//"{ \"login\": { \"user\": \"sdn\", \"password\": \"skyline\",\"domain\":\"sdn\" }}");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried with ca-bundle.cert in place of pem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using or writing an application in windows using curl and C.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Request you to please advice me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Satish K&lt;/P&gt;</description>
      <pubDate>Mon, 01 Dec 2014 10:09:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/software-defined-networking/hp-sdn-van-controller-v2-0-0-4253-token-generation-using-lib/m-p/6679785#M600</guid>
      <dc:creator>SatishK</dc:creator>
      <dc:date>2014-12-01T10:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: HP SDN VAN Controller - V2.0.0.4253 - Token Generation using LIB CURL</title>
      <link>https://community.hpe.com/t5/software-defined-networking/hp-sdn-van-controller-v2-0-0-4253-token-generation-using-lib/m-p/6679790#M601</link>
      <description>&lt;P&gt;Hi Satish,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not an expert on Curl, but do you set an URL with CURLOPT_URL somewhere and what is the value? I think that one is mandatory (see the example at the top of the thread).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wouter&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SDN Team&lt;/P&gt;</description>
      <pubDate>Mon, 01 Dec 2014 10:27:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/software-defined-networking/hp-sdn-van-controller-v2-0-0-4253-token-generation-using-lib/m-p/6679790#M601</guid>
      <dc:creator>Joetel</dc:creator>
      <dc:date>2014-12-01T10:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: HP SDN VAN Controller - V2.0.0.4253 - Token Generation using LIB CURL</title>
      <link>https://community.hpe.com/t5/software-defined-networking/hp-sdn-van-controller-v2-0-0-4253-token-generation-using-lib/m-p/6679858#M602</link>
      <description>&lt;P&gt;Yes,, I set the OPT_URL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also I have created the ceft in my controller and using the same ceft. Even the pass phrase and SSLKEY I am using same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure where it is getting the problem with ceft&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;* Hostname was NOT found in DNS cache&lt;BR /&gt;* Trying 128.88.150.151...&lt;BR /&gt;* Connected to 128.88.150.151 (128.88.150.151) port 8443 (#0)&lt;BR /&gt;* unable to set private key file: 'sdnserver.pem' type PEM&lt;BR /&gt;* Closing connection 0&lt;BR /&gt;curl_easy_perform() failed: Problem with the local SSL certificate&lt;/P&gt;&lt;P&gt;Process returned 0 (0x0) execution time : 0.312 s&lt;BR /&gt;Press any key to continue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Satish K&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Dec 2014 14:18:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/software-defined-networking/hp-sdn-van-controller-v2-0-0-4253-token-generation-using-lib/m-p/6679858#M602</guid>
      <dc:creator>SatishK</dc:creator>
      <dc:date>2014-12-01T14:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: HP SDN VAN Controller - V2.0.0.4253 - Token Generation using LIB CURL</title>
      <link>https://community.hpe.com/t5/software-defined-networking/hp-sdn-van-controller-v2-0-0-4253-token-generation-using-lib/m-p/6679871#M603</link>
      <description>&lt;P&gt;Hi Satish,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you maybe post a snipped of all the SETOPT's that are done? Also maybe doing a run with CURLOPT_VERBOSE and CURLOPT_CERTINFO set might give some more detailed information?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wouter&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SDN Team&lt;/P&gt;</description>
      <pubDate>Mon, 01 Dec 2014 14:52:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/software-defined-networking/hp-sdn-van-controller-v2-0-0-4253-token-generation-using-lib/m-p/6679871#M603</guid>
      <dc:creator>Joetel</dc:creator>
      <dc:date>2014-12-01T14:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: HP SDN VAN Controller - V2.0.0.4253 - Token Generation using LIB CURL</title>
      <link>https://community.hpe.com/t5/software-defined-networking/hp-sdn-van-controller-v2-0-0-4253-token-generation-using-lib/m-p/6680134#M605</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my complete code,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt;CURL *curl;&lt;BR /&gt;CURLcode res;&lt;/P&gt;&lt;P&gt;curl_global_init(CURL_GLOBAL_DEFAULT);&lt;/P&gt;&lt;P&gt;curl = curl_easy_init();&lt;BR /&gt;if(curl) {&lt;/P&gt;&lt;P&gt;struct curl_slist *slist = NULL;&lt;BR /&gt;/* -H Header */&lt;BR /&gt;slist = curl_slist_append(slist, "Content-type: application/json");&lt;BR /&gt;curl_easy_setopt(curl, CURLOPT_HTTPHEADER, slist);&lt;/P&gt;&lt;P&gt;/* URL */&lt;BR /&gt;curl_easy_setopt(curl, CURLOPT_URL, "&lt;A target="_blank" href="https://128.88.150.151:8443/sdn/v2.0/auth&amp;quot;);"&gt;https://128.88.150.151:8443/sdn/v2.0/auth");&lt;/A&gt;&lt;/P&gt;&lt;P&gt;/* -k option */&lt;BR /&gt;curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1);&lt;BR /&gt;curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 1);&lt;BR /&gt;/* Proxy settings */&lt;BR /&gt;//curl_easy_setopt(curl, CURLOPT_PROXY, "&lt;A target="_blank" href="http://172.16.150.32:8080/&amp;quot;);"&gt;http://172.16.150.32:8080/");&lt;/A&gt;&lt;BR /&gt;curl_easy_setopt(curl, CURLOPT_PROXY, "");&lt;BR /&gt;curl_easy_setopt(curl, CURLOPT_SSLKEY, "sdnserver"); // also tried with cakey, cacert&lt;BR /&gt;curl_easy_setopt(curl,CURLOPT_SSLKEYTYPE, "PEM");&lt;BR /&gt;curl_easy_setopt(curl, CURLOPT_CAINFO, "sdnserver.pem"); //also tried with cacert.crt&lt;BR /&gt;curl_easy_setopt(curl, CURLOPT_SSLCERT, "sdnserver.pem");&lt;BR /&gt;curl_easy_setopt(curl, CURLOPT_CERTINFO, 1L);&lt;BR /&gt;curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);&lt;/P&gt;&lt;P&gt;/* -X POST */&lt;BR /&gt;curl_easy_setopt(curl, CURLOPT_POST, 1L);&lt;BR /&gt;curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "{\"login\":{\"user\": \"sdn\", \"password\":\"skyline\" ,\"domain\":\"sdn\"}}");&lt;/P&gt;&lt;P&gt;/* -v option */&lt;BR /&gt;curl_easy_setopt(curl,CURLOPT_VERBOSE,1L);&lt;/P&gt;&lt;P&gt;/* Perform the request, res will get the return code */&lt;BR /&gt;res = curl_easy_perform(curl);&lt;BR /&gt;/* Check for errors */&lt;BR /&gt;if(res != CURLE_OK)&lt;BR /&gt;fprintf(stderr, "curl_easy_perform() failed: %s\n",&lt;BR /&gt;curl_easy_strerror(res));&lt;/P&gt;&lt;P&gt;/* always cleanup */&lt;BR /&gt;curl_slist_free_all(slist);&lt;BR /&gt;curl_easy_cleanup(curl);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;curl_global_cleanup();&lt;/P&gt;&lt;P&gt;return 0;&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Tue, 02 Dec 2014 06:33:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/software-defined-networking/hp-sdn-van-controller-v2-0-0-4253-token-generation-using-lib/m-p/6680134#M605</guid>
      <dc:creator>SatishK</dc:creator>
      <dc:date>2014-12-02T06:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: HP SDN VAN Controller - V2.0.0.4253 - Token Generation using LIB CURL</title>
      <link>https://community.hpe.com/t5/software-defined-networking/hp-sdn-van-controller-v2-0-0-4253-token-generation-using-lib/m-p/6680156#M606</link>
      <description>&lt;P&gt;Even I have created a self sigend ceft in my controller and same im using in client application.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;code as below,&lt;/P&gt;&lt;P&gt;curl_easy_setopt(curl, CURLOPT_PROXY, "");&lt;BR /&gt;curl_easy_setopt(curl, CURLOPT_SSLKEY, "server.key");&lt;BR /&gt;//curl_easy_setopt(curl,CURLOPT_SSLKEYTYPE, "PEM");&lt;BR /&gt;curl_easy_setopt(curl, CURLOPT_CAINFO, "server.crt");&lt;BR /&gt;//curl_easy_setopt(curl, CURLOPT_SSLCERT, "server.crt");&lt;BR /&gt;curl_easy_setopt(curl, CURLOPT_CAPATH, "server");&lt;BR /&gt;curl_easy_setopt(curl, CURLOPT_CERTINFO, 1L);&lt;BR /&gt;curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Getting the error as below,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;* Hostname was NOT found in DNS cache&lt;BR /&gt;* Trying 128.88.150.151...&lt;BR /&gt;* Connected to 128.88.150.151 (128.88.150.151) port 8443 (#0)&lt;BR /&gt;* successfully set certificate verify locations:&lt;BR /&gt;* CAfile: server.crt&lt;BR /&gt;CApath: server&lt;BR /&gt;* SSL certificate problem: self signed certificate&lt;BR /&gt;* Closing connection 0&lt;BR /&gt;curl_easy_perform() failed: Peer certificate cannot be authenticated with given&lt;BR /&gt;CA certificates&lt;/P&gt;&lt;P&gt;Process returned 0 (0x0) execution time : 0.329 s&lt;BR /&gt;Press any key to continue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PLease advice me,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Satish K&lt;/P&gt;</description>
      <pubDate>Tue, 02 Dec 2014 07:37:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/software-defined-networking/hp-sdn-van-controller-v2-0-0-4253-token-generation-using-lib/m-p/6680156#M606</guid>
      <dc:creator>SatishK</dc:creator>
      <dc:date>2014-12-02T07:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: HP SDN VAN Controller - V2.0.0.4253 - Token Generation using LIB CURL</title>
      <link>https://community.hpe.com/t5/software-defined-networking/hp-sdn-van-controller-v2-0-0-4253-token-generation-using-lib/m-p/6680298#M607</link>
      <description>&lt;P&gt;Hi Satish,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you elaborate a bit on what your goal is? Are you trying to&amp;nbsp;establish SSL communication with two way, one way, or no authentication? Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wouter&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SDN Team&lt;/P&gt;</description>
      <pubDate>Tue, 02 Dec 2014 15:58:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/software-defined-networking/hp-sdn-van-controller-v2-0-0-4253-token-generation-using-lib/m-p/6680298#M607</guid>
      <dc:creator>Joetel</dc:creator>
      <dc:date>2014-12-02T15:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: HP SDN VAN Controller - V2.0.0.4253 - Token Generation using LIB CURL</title>
      <link>https://community.hpe.com/t5/software-defined-networking/hp-sdn-van-controller-v2-0-0-4253-token-generation-using-lib/m-p/6680540#M608</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to establish a two way communication,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To communicate or access any API of controller, I need token which I can use in further request to communicate.&lt;/P&gt;&lt;P&gt;So this is what I am trying to access using the OpenSSL and Curl to get a token which can be used furhter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have written the Curl code in windows mc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Satish K&lt;/P&gt;</description>
      <pubDate>Wed, 03 Dec 2014 05:41:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/software-defined-networking/hp-sdn-van-controller-v2-0-0-4253-token-generation-using-lib/m-p/6680540#M608</guid>
      <dc:creator>SatishK</dc:creator>
      <dc:date>2014-12-03T05:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: HP SDN VAN Controller - V2.0.0.4253 - Token Generation using LIB CURL</title>
      <link>https://community.hpe.com/t5/software-defined-networking/hp-sdn-van-controller-v2-0-0-4253-token-generation-using-lib/m-p/6682729#M616</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Same is working using Cygwin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure what is the issue with windows,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Satish K&lt;/P&gt;</description>
      <pubDate>Tue, 09 Dec 2014 07:56:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/software-defined-networking/hp-sdn-van-controller-v2-0-0-4253-token-generation-using-lib/m-p/6682729#M616</guid>
      <dc:creator>SatishK</dc:creator>
      <dc:date>2014-12-09T07:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: HP SDN VAN Controller - V2.0.0.4253 - Token Generation using LIB CURL</title>
      <link>https://community.hpe.com/t5/software-defined-networking/hp-sdn-van-controller-v2-0-0-4253-token-generation-using-lib/m-p/6682759#M617</link>
      <description>&lt;P&gt;Hi Satish,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We&amp;nbsp;have been in contact via PMs and you have things going now, but for the record and maybe for the benefit of&amp;nbsp;anybody else reading this thread,&amp;nbsp;I wanted to post a working example with a generic (non Cygwin) implementation of libcurl:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT size="1"&gt;// GetTokenWithLibcurl.cpp : main project file. V1.0
//
// Program retrieves a token from the HP VAN SDN Controller (version 2.4.5.0614) REST API using libcurl
//
// Win 8.1 64 bit, VS2013 Update 4, libcurl 7.39.0-win64 (http://www.confusedbycode.com/curl/)
// WJA20141209

#include "stdafx.h"
#include "curl/curl.h"

int main(void)
{
        
        CURL *curl;
        CURLcode res;

        curl_global_init(CURL_GLOBAL_DEFAULT);

        curl = curl_easy_init();
        if (curl) {

                /* -H Header */
                struct curl_slist *slist = NULL;
                slist = curl_slist_append(slist, "Content-type: application/json");
                curl_easy_setopt(curl, CURLOPT_HTTPHEADER, slist);

                /* URL */
                curl_easy_setopt(curl, CURLOPT_URL, "https://192.168.1.19:8443/sdn/v2.0/auth");

                /*  Do not check servers certificate against bundle - it is self-signed in my case */
                curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);

                /* Also do not check whether the hostname in the certificate matches the servers hostname */
                curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);

                /* Proxy settings - No proxy needed in my case*/
                //curl_easy_setopt(curl, CURLOPT_PROXY, "http://X.X.X.X:8080/");

                /* Wordy settings for libcurl, 0L to turn off */
                curl_easy_setopt(curl, CURLOPT_CERTINFO, 1L);
                curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);

                /* Action POST */
                curl_easy_setopt(curl, CURLOPT_POST, 1L);
                curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "{\"login\":{\"user\": \"sdn\", \"password\":\"skyline\" ,\"domain\":\"sdn\"}}");

                /* Perform the request */
                res = curl_easy_perform(curl);

                /* Check for errors */
                if (res != CURLE_OK)
                        fprintf(stderr, "curl_easy_perform() failed: %s\n",
                        curl_easy_strerror(res));

                /* cleanup */
                curl_slist_free_all(slist);
                curl_easy_cleanup(curl);
        }

        curl_global_cleanup();

        return 0;
}&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The resulting output is as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT size="1"&gt;* Hostname was NOT found in DNS cache
*   Trying 192.168.1.19...
* Connected to 192.168.1.19 (192.168.1.19) port 8443 (#0)
* SSL connection using TLSv1.0 / EDH-DSS-DES-CBC3-SHA
* --- Certificate chain
*  0 Subject: C=CA; ST=CA; L=Palo Alto; O=HP; OU=HP SDN Controller; CN=127.0.1.1

*    Issuer: C=CA; ST=CA; L=Palo Alto; O=HP; OU=HP SDN Controller; CN=127.0.1.1
*    Version: 3 (0x2)
*    Serial Number: 482821021 (0x1cc7439d)
*    Signature Algorithm: dsaWithSHA1
*    Start date: 2014-12-05 11:45:12 GMT
*    Expire date: 2015-03-05 11:45:12 GMT
*    Public Key Algorithm: dsaEncryption
*    dsa(p): fd:7f:53:81:1d:75:12:29:52:df:4a:9c:2e:ec:e4:e7:f6:11:b7:52:3c:ef:4
4:00:c3:1e:3f:80:b6:51:26:69:45:5d:40:22:51:fb:59:3d:8d:58:fa:bf:c5:f5:ba:30:f6:
cb:9b:55:6c:d7:81:3b:80:1d:34:6f:f2:66:60:b7:6b:99:50:a5:a4:9f:9f:e8:04:7b:10:22
:c2:4f:bb:a9:d7:fe:b7:c6:1b:f8:3b:57:e7:c6:a8:a6:15:0f:04:fb:83:f6:d3:c5:1e:c3:0
2:35:54:13:5a:16:91:32:f6:75:f3:ae:2b:61:d7:2a:ef:f2:22:03:19:9d:d1:48:01:c7:
*    dsa(q): 97:60:50:8f:15:23:0b:cc:b2:92:b9:82:a2:eb:84:0b:f0:58:1c:f5:
*    dsa(g): f7:e1:a0:85:d6:9b:3d:de:cb:bc:ab:5c:36:b8:57:b9:79:94:af:bb:fa:3a:e
a:82:f9:57:4c:0b:3d:07:82:67:51:59:57:8e:ba:d4:59:4f:e6:71:07:10:81:80:b4:49:16:
71:23:e8:4c:28:16:13:b7:cf:09:32:8c:c8:a6:e1:3c:16:7a:8b:54:7c:8d:28:e0:a3:ae:1e
:2b:b3:a6:75:91:6e:a3:7f:0b:fa:21:35:62:f1:fb:62:7a:01:24:3b:cc:a4:f1:be:a8:51:9
0:89:a8:83:df:e1:5a:e5:9f:06:92:8b:66:5e:80:7b:55:25:64:01:4c:3b:fe:cf:49:2a:
*    dsa(pub_key): 2e:27:9e:8b:6b:63:86:48:5c:0c:7e:98:53:76:eb:d5:b2:17:e2:e8:0
0:ff:ff:02:50:2d:d7:62:a0:4c:76:9d:23:8a:81:93:71:44:44:ce:69:d1:d7:cb:10:52:c2:
4a:e4:cd:c0:ff:75:b1:87:03:31:db:a2:19:69:94:42:ee:82:c3:5f:30:f5:c5:a8:4d:0c:ff
:2a:a8:1f:2d:e1:71:45:24:ee:3b:5f:71:2d:21:cf:25:98:d1:a1:b8:7b:71:0d:00:bb:8c:8
4:3a:b3:48:d8:1c:c7:26:e1:2f:f5:16:5d:55:5b:4a:3a:da:e2:8a:fb:5a:26:11:8b:c8:a6:
55:
* X509v3 Subject Alternative Name:
*   IPAddress:127.0.1.1,IPAddress:127.0.0.1
* X509v3 Subject Key Identifier:
*   28:40:C7:69:25:18:62:C8:B5:B7:4F:08:67:8F:10:DF:31:36:9A:08
*  Signature: 30:2c:02:14:45:dc:fb:27:cb:5e:04:d9:46:7a:a6:30:69:66:52:84:28:a3:
d9:57:02:14:4e:e8:41:c7:e1:45:c0:97:c5:d1:f0:8d:e6:79:ce:df:a8:c6:66:d0:
* Server certificate:
*        subject: C=CA; ST=CA; L=Palo Alto; O=HP; OU=HP SDN Controller; CN=127.0
.1.1
*        start date: 2014-12-05 11:45:12 GMT
*        expire date: 2015-03-05 11:45:12 GMT
*        issuer: C=CA; ST=CA; L=Palo Alto; O=HP; OU=HP SDN Controller; CN=127.0.
1.1
*        SSL certificate verify result: self signed certificate (18), continuing
 anyway.
&amp;gt; POST /sdn/v2.0/auth HTTP/1.1
Host: 192.168.1.19:8443
Accept: */*
Content-type: application/json
Content-Length: 63

* upload completely sent off: 63 out of 63 bytes
&amp;lt; HTTP/1.1 200 OK
&amp;lt; Server: Apache-Coyote/1.1
&amp;lt; X-FRAME-OPTIONS: deny
&amp;lt; Cache-Control: no-cache, no-store, no-transform, must-revalidate
&amp;lt; Expires: Tue, 09 Dec 2014 09:18:00 GMT
&amp;lt; Access-Control-Allow-Origin: *
&amp;lt; Access-Control-Allow-Methods: GET, POST, PUT, HEAD, PATCH
&amp;lt; Access-Control-Allow-Headers: Content-Type, Accept, X-Auth-Token
&amp;lt; Content-Type: application/json
&amp;lt; Transfer-Encoding: chunked
&amp;lt; Date: Tue, 09 Dec 2014 09:18:00 GMT
&amp;lt;
{"record":{"token":"0ade4491543c4ac990685bf666360f62","expiration":1418120279000
,"expirationDate":"2014-12-09 02-17-59 -0800","userId":"0a4cafa0813b4b57a4f2991e
349fb382","userName":"sdn","domainId":"bcf9169f1f144f0ca160f527df47da9f","domain
Name":"sdn"}}* Connection #0 to host 192.168.1.19 left intact
Press any key to continue . . .&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Best regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wouter&lt;/P&gt;&lt;P&gt;HP SDN CoE Team&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Dec 2014 09:29:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/software-defined-networking/hp-sdn-van-controller-v2-0-0-4253-token-generation-using-lib/m-p/6682759#M617</guid>
      <dc:creator>Joetel</dc:creator>
      <dc:date>2014-12-09T09:29:48Z</dc:date>
    </item>
  </channel>
</rss>

