【问题标题】:Setting ns-cert-type server for OpenVPN using phpseclib使用 phpseclib 为 OpenVPN 设置 ns-cert-type 服务器
【发布时间】:2014-11-24 08:18:01
【问题描述】:

由于 phpseclib 的文档很差,我在这里询问是否有办法为该库的证书设置 ns-cert-type

搜索资源,我发现了这个:

        // the following OIDs are unsupported but we don't want them to give notices when calling saveX509().
        case 'id-pe-logotype': // http://www.ietf.org/rfc/rfc3709.txt
        case 'entrustVersInfo':
        // http://support.microsoft.com/kb/287547
        case '1.3.6.1.4.1.311.20.2': // szOID_ENROLL_CERTTYPE_EXTENSION
        case '1.3.6.1.4.1.311.21.1': // szOID_CERTSRV_CA_VERSION
        // "SET Secure Electronic Transaction Specification"
        // http://www.maithean.com/docs/set_bk3.pdf
        case '2.23.42.7.0': // id-set-hashedRootKey
            return true;

我认为有趣的部分是szOID_ENROLL_CERTTYPE_EXTENSION,但它似乎不受支持:(

有什么解决方法吗?

【问题讨论】:

    标签: php x509 openvpn phpseclib


    【解决方案1】:

    找到了:

    $x509->setExtension('netscape-cert-type', array('SSLServer'));
    

    它与 OpenVPN 完美配合!

    来源:

    // mapping is from <http://www.mozilla.org/projects/security/pki/nss/tech-notes/tn3.html>
    $this->netscape_cert_type = array(
        'type'    => FILE_ASN1_TYPE_BIT_STRING,
        'mapping' => array(
            'SSLClient',
            'SSLServer',
            'Email',
            'ObjectSigning',
            'Reserved',
            'SSLCA',
            'EmailCA',
            'ObjectSigningCA'
        )
    );
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-22
      • 1970-01-01
      • 2020-10-19
      • 2011-12-18
      • 1970-01-01
      • 2022-01-09
      • 2016-01-20
      • 2022-11-09
      相关资源
      最近更新 更多