• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

使用HSE_REQ_GET_CERT_INFO_EX调用ServerSupportFunction后,pCertInfo为null

用户头像
it1352
帮助1

问题说明

  我试图从ISAPI扩展中获取主题备用名称(电子邮件地址)。但是,pCertInfo始终为null。

   I am trying to get the subject alternative name (email address) from within an ISAPI Extension. However, pCertInfo is always null.

     CERT_CONTEXT_EX certContextEx;
        memset(&certContextEx,0,sizeof(CERT_CONTEXT_EX));
        char certbuf[64*1024];
        certContextEx.cbAllocated =sizeof(certbuf);
        certContextEx.CertContext.pbCertEncoded =(BYTE *)&certbuf;
        BOOL gotCert = pECB->ServerSupportFunction(pECB->ConnID, HSE_REQ_GET_CERT_INFO_EX,&certContextEx,0,0);

        logFile << "got cert context ex successfully? " << (gotCert==1?"true":"false") << std::endl;
        logFile.flush();

        char certTemp[BUFFER_SIZE];
        wsprintf(certTemp,"cert encoded size %d\n",certContextEx.CertContext.cbCertEncoded);
        logFile << certTemp;
        logFile.flush();

        logFile << "pbCertEncoded " << certContextEx.CertContext.pbCertEncoded << std::endl;
        logFile.flush();

        logFile << "pCert Info " << certContextEx.CertContext.pCertInfo << std::endl;
        logFile.flush();

输出

**********

**********

成功获得证书上下文? true

got cert context ex successfully? true

证书编码大小1290

cert encoded size 1290

pbCertEncoded 0,0, î [1] [1] [1]
2ÒÌ0

pbCertEncoded 0‚0‚ î [1][1][1] 2ÒÌ0

     *†H†÷

pCert Info 00000000

pCert Info 00000000

**************** ****

********************

我认为我需要做以下的事情来获得正确的扩展。 当然'j'需要是正确的索引,但pCertInfo始终为null。 

I believe I need to do something like the following to get the right extension.  Of course 'j' would need to be the right index but pCertInfo is always null. 

certContextEx.CertContext.pCertInfo->->rgExtension[j]


那么我该如何得到pCertInfo值?

So how do I get the pCertInfo to be value?

正确答案

#1
也许你可以试试IIS论坛: 
http://forums.iis.net/

perhaps you can try IIS forum:  http://forums.iis.net/

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /reply/detail/tanhcbijgh
系列文章
更多 icon
同类精品
更多 icon
继续加载