【问题标题】:How can I use IPWorks with a self-signed SSL certificate?如何将 IPWorks 与自签名 SSL 证书一起使用?
【发布时间】:2021-04-26 00:53:40
【问题描述】:

我正在尝试找到一种方法来使用带有自签名 SSL 证书的 /n Software's IPWorks 服务器/客户端组件。

我正在客户端尝试这个:

cl.SSLCertStoreType := cstPFXFile;
cl.SSLCertStore := 'cert.pfx';
cl.SSLCertStorePassword := 'password';
cl.Connect('localhost',5050);

这在服务器端:

server.SSLCertStoreType :=  cstPFXFile;
server.SSLCertStore := 'cert.pfx';
server.SSLCertStorePassword := 'password';
server.LocalPort:= 5050;
server.SSLEnabled:=true;
server.Listening := true;

PFX 文件有效,但应用程序给出一个错误,指出它不是有效的证书。

有人有一个可行的例子吗?

【问题讨论】:

  • 根据 IPWorks 网站上的此文档,可以使用同一 IPWorks 库提供的 CertMgr 类生成自签名证书。 nsoftware.com/kb/xml/11080101.rst > 要生成证书,只需调用 IPWorks SSL 中包含的 CertMgr 组件的 CreateCertificate 方法即可。此方法以 > 主题和序列号作为参数: > > CertMgr1.CreateCertificate "CN=My Cert Subject", 0000001 可能使用此证书而不是任何其他方法。不添加此作为答案,因为尚未尝试

标签: delphi ipworks nsoftware


【解决方案1】:

根据 IPWorks 网站上的此文档,可以使用同一 IPWorks 库提供的 CertMgr 类生成自签名证书。

https://www.nsoftware.com/kb/xml/11080101.rst

要生成证书,只需调用 CreateCertificate 方法 IPWorks SSL 中包含的 CertMgr 组件。这种方法需要一个 主题和序列号作为参数:

CertMgr1.CreateCertificate "CN=My Cert Subject", 0000001

Certmgr certMgr1 = new Certmgr();
certMgr1.RuntimeLicense = ""; //Assign your license, otherwise you'll get exception
certMgr1.CreateCertificate("CN=My Cert Subject", 000001);
//Use certMgr1.Cert property to use generated Self-signed certificate

【讨论】:

    猜你喜欢
    • 2011-04-08
    • 1970-01-01
    • 2021-10-23
    • 2011-12-23
    • 2013-10-30
    • 2020-10-25
    • 1970-01-01
    • 2021-02-19
    • 2012-11-01
    相关资源
    最近更新 更多