客户端证书未绑定到特定 IP 或域?

Client Certificates not bind to specific IP or Domain?

如果我生成如下客户端证书,则客户端证书有效

openssl req -config openssl.cnf -new -nodes -subj '/C=RO/ST=Bucharest/L=Bucharest/O=XXX/emailAddress=wdw@gmail.com/CN=192.1.61.7' -keyout private/client.key -out client.csr

192.1.61.7是我客户端的IP地址,使用生成的客户端证书。

我希望来自任何 IP 地址的计算机都可以使用客户端证书。

我尝试了 CN=*.*.*.*CN=*,都没有用。

服务器端是我无法更改的 logstash tcp 输入过滤器。

客户端证书必须绑定到特定的 IP 或域吗?如何生成不绑定任何IP和域的客户端证书?

Must the client certificate be bind to a specific IP or domains?

没有。但是事情的处理方式取决于您所在的 PKI 运行。每个 PKI 可以不同。

您可以使用传统的 Distinguished Name (DN) from RFC 4511 标识用户,例如组织 (O) 和组织单位 (OU)。或者您可以使用备用名称来标识它们。

您可以通过以下方式通过别名识别主题。来自 RFC 5280, Section 4.2.1.6, Subject Alternative Name:

GeneralName ::= CHOICE {
    otherName                       [0]     OtherName,
    rfc822Name                      [1]     IA5String,
    dNSName                         [2]     IA5String,
    x400Address                     [3]     ORAddress,
    directoryName                   [4]     Name,
    ediPartyName                    [5]     EDIPartyName,
    uniformResourceIdentifier       [6]     IA5String,
    iPAddress                       [7]     OCTET STRING,
    registeredID                    [8]     OBJECT IDENTIFIER }

在上面,您习惯使用dNSName作为服务器证书。客户端证书可以使用rfc822NamedirectoryNameotherName等GeneralName。

您使用什么取决于您的 PKI。我相信 Microsoft 客户端证书使用 otherName 和自定义 OID。另请参阅信息安全堆栈交换中的 How to encode a username in PKIX certificate

您可能还想搜索 Client Certificate GeneralName 并阅读一些内容。


How to generate a client certificate not binding to any IP and domain?

这取决于您使用的工具和您的 PKI。

至少,您可能不得不在没有 CONF 文件的情况下停止使用 openssl 命令行工具,因为它太有限了。您不能通过命令行选项设置主题备用名称。相反,您将不得不使用 CONF 文件。