且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

cURL PHP具有自签名证书的私有服务器之间的适当SSL

更新时间:2023-08-31 21:37:28

您需要根据客户端的请求生成具有有效主机名的证书。如果您已使用 machine.local 作为内部名称,但现在想要使用通过 machine.example.org $调用它的外部客户端c $ c>,那么您需要使用的证书对 machine.example.org 有效。

You need to generate a certificate with a valid host name, as requested by the client. If you've used machine.local for your internal name, but now want to use external clients calling it via machine.example.org, then you need the certificate you use to be valid for machine.example.org.

如果您需要两者(因为可以使用不同的主机名调用同一台机器),请使用主题备用名称扩展名并在证书中放入多个DNS条目。

If you need both (since the same machine may be called with different host names), use the Subject Alternative Name extension and put multiple DNS entries in your certificate.