HTTP Error 12057 (Bug fix note)

Source: Internet
Author: User

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 ));

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.