zoukankan      html  css  js  c++  java
  • MSXML2.ServerXMLHTTP & HTTPS & 证书过期 — msxml3.dll '80072f05'

    昨天测试一个几天前写的一个应用,时不时的报错:

    msxml3.dll  '80072f05'

    The date in the certificate is invalid or has expired

    经过上午3个小时的努力,终于找到原因和解决办法。

    原因: 证书过期

    解决办法:

    Dim xmlhttp
    Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
          
    xmlhttp.setOption(2) = 13056 '解决因证书错误(证书过期): xmlhttp.send (data) '有可能抛出: The date in the certificate is invalid or has expired

    这个办法来自: http://geekswithblogs.net/narent/archive/2008/09/24/125418.aspx 

    Following code will display error: The date in the certificate is invalid or has expired. if the SSL cerificate on the server is expired.

    set objHttp = Server.CreateObject("MSXML2.ServerXMLHTTP.3.0")
    objHttp.Open "POST", "https://<POSTURL>", false
    objHttp.send objRequest

    We need to update the SSL certificate to get it work, we can also ignore the above error just by adding following highlightrd lines in the code, in that case communication will no longer be secure.

    Const SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS = 13056
    set objHttp = Server.CreateObject("MSXML2.ServerXMLHTTP.3.0")
    objHttp.setOption(2) = SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS
    objHttp.Open "POST", "https://<POSTURL>", false
    objHttp.send objRequest

    2013-04-17

  • 相关阅读:
    为什么new的普通数组用delete 和 delete[]都能正确释放
    虚幻4属性系统(反射)
    CFileDialog类的默认路径
    把单一元素的数组放在一个struct的尾端
    在UE4中使用SVN作为source control工具
    单精度浮点数和有效位数为什么是7位
    Valid Number--LeetCode
    归并排序
    堆排序
    直接选择排序
  • 原文地址:https://www.cnblogs.com/personnel/p/4584881.html
Copyright © 2011-2022 走看看