Openssl invalid_purpose

Jan*_*non 4 openssl

当Openssl生成invalid_purpose时会查看哪些证书字段?

我正在使用OpenSSL生成证书.

首先,我生成一个主证书,然后是客户端证书.现在,当我尝试连接服务器时,它会生成Invalid_Purpose.

Edu*_*Edu 9

有一个扩展名keyUsage,指定可以使用证书执行的操作.请注意,某些程序未使用此字段.

从X509文档:

X509_V_ERR_INVALID_PURPOSE: unsupported certificate purpose
    the supplied certificate cannot be used for the specified purpose.
Run Code Online (Sandbox Code Playgroud)

手册页x509v3_config(5)列出了参数的可能值以及另一个名为的值extendedKeyUsage:

Key Usage.
    Key usage is a multi valued extension consisting of a list of names of
    the permitted key usages.

    The supporte names are: digitalSignature, nonRepudiation,
    keyEncipherment, dataEncipherment, keyAgreement, keyCertSign, cRLSign,
    encipherOnly and decipherOnly.

    Examples:
     keyUsage=digitalSignature, nonRepudiation
     keyUsage=critical, keyCertSign 

Extended Key Usage.
    This extensions consists of a list of usages indicating purposes for
    which the certificate public key can be used for,

    These can either be object short names of the dotted numerical form of
    OIDs.  While any OID can be used only certain values make sense. In
    particular the following PKIX, NS and MS values are meaningful:

     Value                  Meaning
     -----                  -------
     serverAuth             SSL/TLS Web Server Authentication.
     clientAuth             SSL/TLS Web Client Authentication.
     codeSigning            Code signing.
     emailProtection        E-mail Protection (S/MIME).
     timeStamping           Trusted Timestamping
     msCodeInd              Microsoft Individual Code Signing (authenticode)
     msCodeCom              Microsoft Commercial Code Signing (authenticode)
     msCTLSign              Microsoft Trust List Signing
     msSGC                  Microsoft Server Gated Crypto
     msEFS                  Microsoft Encrypted File System
     nsSGC                  Netscape Server Gated Crypto

    Examples:
     extendedKeyUsage=critical,codeSigning,1.2.3.4
     extendedKeyUsage=nsSGC,msSGC
Run Code Online (Sandbox Code Playgroud)