[HTTP] add http cert function

Change-Id: I8be119fa23a8bd11a363a1533ddfedf24af23271
diff --git a/mbtk/include/mbtk/mbtk_http.h b/mbtk/include/mbtk/mbtk_http.h
index 4721ac0..ad3750d 100755
--- a/mbtk/include/mbtk/mbtk_http.h
+++ b/mbtk/include/mbtk/mbtk_http.h
@@ -227,6 +227,7 @@
     char uri[MBTK_HTTP_URI_MAX + 1];
     int port;
     bool is_ssl;
+    bool ingnore_cert;  //FALSE:need cert
 
     mbtk_http_session_req_t req;
     mbtk_http_session_rsp_t rsp;
@@ -362,6 +363,7 @@
         mbtk_http_version_enum version);
 int mbtk_http_session_option_reset(int handle_id, int session_id, mbtk_http_option_enum option);
 int mbtk_http_session_type_set(int handle_id, int session_id, mbtk_http_type_enum type);
+int mbtk_http_session_ingnore_cert_set(int handle_id, int session_id, bool ingnore_cert);
 int mbtk_http_session_free(int handle_id,int session_id);
 int mbtk_http_session_url_set(int handle_id,int session_id,void *url);
 int mbtk_http_session_head_add(int handle_id,int session_id,
diff --git a/mbtk/mbtk_lib/src/mbtk_http.c b/mbtk/mbtk_lib/src/mbtk_http.c
index b4e58ee..b7ab671 100755
--- a/mbtk/mbtk_lib/src/mbtk_http.c
+++ b/mbtk/mbtk_lib/src/mbtk_http.c
@@ -1137,6 +1137,7 @@
     session->id = session_index;
     session->state = HTTP_SESSION_STATE_NON;
     session->is_ssl = FALSE;
+    session->ingnore_cert = TRUE;
     session->version = version;
     session->option = option;
     session->req.content_len = 0;
@@ -1189,6 +1190,23 @@
     return 0;
 }
 
+int mbtk_http_session_ingnore_cert_set(int handle_id, int session_id, bool ingnore_cert)
+{
+    if(!http_session_check(handle_id,session_id))
+    {
+        LOGE("Session error.");
+        return -1;
+    }
+
+    mbtk_http_session_t *session = http_handles[handle_id].session[session_id];
+
+    session->ingnore_cert = ingnore_cert;
+
+    LOGE("session->ingnore_cert:%d, ingnore_cert:%d\n", session->ingnore_cert, ingnore_cert);
+    return 0;
+}
+
+
 int mbtk_http_session_free(int handle_id,int session_id)
 {
     if(!http_session_check(handle_id,session_id))
@@ -1365,12 +1383,14 @@
 
         LOGI("HTTP request start.");
         LOGI("host:%s, port:%d, uri:%s",session->host,session->port,session->uri);
-        LOGI("is_ssl:%d, version:%d, option:%d, content_len:%d",session->is_ssl,
-             session->version,session->option,session->req.content_len);
+        LOGI("is_ssl:%d,ingnore_cert:%d, version:%d, option:%d, content_len:%d",session->is_ssl, 
+            session->ingnore_cert, session->version,session->option,session->req.content_len);
 
-        int sock_fd = mbtk_http_open(session->is_ssl,TRUE,session->host,session->port);
+        int sock_fd = mbtk_http_open(session->is_ssl,session->ingnore_cert,session->host,session->port);
+
         if(sock_fd < 0)
         {
+            LOGE("mbtk_http_open() fail.");
             return -1;
         }
         session->sock_fd = sock_fd;