如何将IPWorks与自签名SSL证书一起使用



我正试图找到一种方法,使用带有自签名SSL证书的/n软件的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类生成自签名证书。

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

最新更新