[HTTP] add http cert function
Change-Id: I8be119fa23a8bd11a363a1533ddfedf24af23271
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;