From: MyeongSeong Seo Date: Wed, 10 Apr 2013 06:34:17 +0000 (+0900) Subject: Fix the issue for remaining previous ssl Info X-Git-Tag: accepted/tizen_2.1/20130425.034729~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ff0604f4919f957496b5fb26b1f4d50e8a1462cc;p=framework%2Fosp%2Fnet.git Fix the issue for remaining previous ssl Info Change-Id: I7c2706dfb55695e11980e8e2c66a3ba850883f4b Signed-off-by: MyeongSeong Seo --- diff --git a/src/http/FNetHttp_HttpMultipleConnectionInfo.cpp b/src/http/FNetHttp_HttpMultipleConnectionInfo.cpp old mode 100644 new mode 100755 index aee0cb9..9ed6b42 --- a/src/http/FNetHttp_HttpMultipleConnectionInfo.cpp +++ b/src/http/FNetHttp_HttpMultipleConnectionInfo.cpp @@ -298,6 +298,24 @@ _HttpMultipleConnectionInfo::CheckCurlMultiStatus(void) //Check if the curlCode is CURLE_OK if (curlCode == CURLE_OK) { + SysLog(NID_NET_HTTP, "The curlCode is CURLE_OK."); + + _HttpSslInfo* pSSLInfo = _HttpUtility::GetSslCertInfo(pHttpTransactionUserData->GetSocketFd()); + + if (pSSLInfo != null) + { + if (pSSLInfo->GetCertificateVerificationFlag() == HTTP_CV_FLAG_MANUAL) + { + r = _HttpUtility::RemoveSslCertInfo(*pSSLInfo); + if (IsFailed(r)) + { + SysLogException(NID_NET_HTTP, E_SYSTEM, "[E_SYSTEM] Failed to remove the server cert."); + } + + SysLog(NID_NET_HTTP, "The server certificate is removed."); + } + } + int readBodySize = 0; if (!pHttpTransactionImpl->IsHeaderEventFired()) diff --git a/src/http/FNetHttp_HttpTransactionEvent.cpp b/src/http/FNetHttp_HttpTransactionEvent.cpp old mode 100644 new mode 100755 index e8f7a48..653e9ce --- a/src/http/FNetHttp_HttpTransactionEvent.cpp +++ b/src/http/FNetHttp_HttpTransactionEvent.cpp @@ -96,6 +96,12 @@ _HttpTransactionEvent::GetHttpSessionImpl(void) const return __pHttpSessionImpl; } +_HttpTransactionImpl* +_HttpTransactionEvent::GetHttpTransactionImpl(void) const +{ + return __pHttpTransactionImpl; +} + result _HttpTransactionEvent::FireTransactionReadyToReadEvent(int readBodyLength, bool async) { diff --git a/src/http/FNetHttp_HttpTransactionEvent.h b/src/http/FNetHttp_HttpTransactionEvent.h old mode 100644 new mode 100755 index 029eeda..d156d33 --- a/src/http/FNetHttp_HttpTransactionEvent.h +++ b/src/http/FNetHttp_HttpTransactionEvent.h @@ -63,6 +63,8 @@ public: _HttpSessionImpl* GetHttpSessionImpl(void) const; + _HttpTransactionImpl* GetHttpTransactionImpl(void) const; + result FireTransactionReadyToReadEvent(int readBodyLength, bool async = false); result FireTransactionReadyToWriteEvent(int recommenedLength, bool async = false); diff --git a/src/http/FNetHttp_HttpTransactionImpl.cpp b/src/http/FNetHttp_HttpTransactionImpl.cpp old mode 100644 new mode 100755 index 27b16b2..7e93d6d --- a/src/http/FNetHttp_HttpTransactionImpl.cpp +++ b/src/http/FNetHttp_HttpTransactionImpl.cpp @@ -1951,11 +1951,22 @@ _HttpTransactionImpl::OnHttpSslVerify(int preverify_ok, X509_STORE_CTX* pX509ctx if (pExistSslInfo != null) { + SysLog(NID_NET_HTTP, "The SslInfo is existed."); + bool certVerificationResult = false; _HttpTransactionEvent* pHttpTransactionEvent = pExistSslInfo->GetHttpTransactionEvent(); SysTryReturn(NID_NET_HTTP, pHttpTransactionEvent != null, 0, E_SYSTEM, "[E_SYSTEM] pHttpTransactionEvent must not be null."); + _HttpTransactionImpl* pHttpTransactionImpl = pHttpTransactionEvent->GetHttpTransactionImpl(); + SysTryReturn(NID_NET_HTTP, pHttpTransactionImpl != null, 0, E_SYSTEM, "[E_SYSTEM] pHttpTransactionImpl must not be null."); + + if (pHttpTransactionImpl->GetServerCertificateVerification() != HTTP_CV_FLAG_MANUAL) + { + SysLog(NID_NET_HTTP, "The server certificate verification is not HTTP_CV_FLAG_MANUAL."); + return 1; + } + if (pHttpTransactionEvent->GetCertRequestedResult()) { SysLog(NID_NET_HTTP, "The certificate verification is already resumed."); @@ -2042,6 +2053,8 @@ _HttpTransactionImpl::OnHttpSslVerify(int preverify_ok, X509_STORE_CTX* pX509ctx } else { + SysLog(NID_NET_HTTP, "The SslInfo is not existed."); + // The certificateFlag is HTTP_CV_FLAG_AUTOMATIC. if (error != X509_V_OK) {