The product was reported with a bug that only occurred on a specific platform Windows Server 2003 Standard Edition.
Check the trace log and find that error 12057 is returned for the encapsulation class called by wininet. The specific error content is:
-
Error_winhttp_secure_cert_rev_failed
-
12057
Indicates that revocation cannot be checked because the revocation server was offline (equivalent to crypt_e_revocation_offline ).
Open IE-> Tools-> Internet Options-> Advanced tab-> Security Options-> "check for server certificate revocation (requires restart )"
This option is currently selected. Disable this option to cause the bug to disappear. After testing, we found that this option is selected by default only for IE of Windows Server 2003 Standard Edition, and no error 12057 (Microsoft's bug? Or with other options ?). We decided to solve this problem by coding.
In fact, encoding solves this problem very easily. After httpopenrequest, add the following code and set the current HTTP connection option to cancel this check.
DWORD dwflags = 0;
DWORD dwerror = 0;
DWORD dwbufflen = sizeof (dwflags );
Internetqueryoption (m_hrequest, internet_option_security_flags,
(Lpvoid) & dwflags, & dwbufflen );
Dwflags | = security_flag_ignore_revocation;
Internetsetoption (m_hrequest, internet_option_security_flags, (lpvoid) & dwflags, sizeof (dwflags ));