Fix the issue for remaining previous ssl Info
authorMyeongSeong Seo <ms49.seo@samsung.com>
Wed, 10 Apr 2013 06:34:17 +0000 (15:34 +0900)
committerMyeongSeong Seo <ms49.seo@samsung.com>
Wed, 10 Apr 2013 06:34:17 +0000 (15:34 +0900)
Change-Id: I7c2706dfb55695e11980e8e2c66a3ba850883f4b
Signed-off-by: MyeongSeong Seo <ms49.seo@samsung.com>
src/http/FNetHttp_HttpMultipleConnectionInfo.cpp [changed mode: 0644->0755]
src/http/FNetHttp_HttpTransactionEvent.cpp [changed mode: 0644->0755]
src/http/FNetHttp_HttpTransactionEvent.h [changed mode: 0644->0755]
src/http/FNetHttp_HttpTransactionImpl.cpp [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index aee0cb9..9ed6b42
@@ -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())
old mode 100644 (file)
new mode 100755 (executable)
index e8f7a48..653e9ce
@@ -96,6 +96,12 @@ _HttpTransactionEvent::GetHttpSessionImpl(void) const
        return __pHttpSessionImpl;
 }
 
+_HttpTransactionImpl*
+_HttpTransactionEvent::GetHttpTransactionImpl(void) const
+{
+       return __pHttpTransactionImpl;
+}
+
 result
 _HttpTransactionEvent::FireTransactionReadyToReadEvent(int readBodyLength, bool async)
 {
old mode 100644 (file)
new mode 100755 (executable)
index 029eeda..d156d33
@@ -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);
old mode 100644 (file)
new mode 100755 (executable)
index 27b16b2..7e93d6d
@@ -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)
                {