【发布时间】:2016-05-25 19:39:29
【问题描述】:
我正在尝试使用我在 tomcat 中创建和部署的 web 服务,在后者中启用 ssl。
为了创建客户端代码,我使用 gsoap。我生成了 nedded 文件,并在我的 C++ 代码下方:
soap_ssl_init();
soap_init(&soap);
if (soap_ssl_client_context(&soap,
SOAP_SSL_DEFAULT, /* use SOAP_SSL_DEFAULT in production code */
NULL, /* keyfile: required only when client must authenticate to server (see SSL docs on how to obtain this file) */
NULL, /* password to read the keyfile */
"cacert.pem", /* optional cacert file to store trusted certificates */
NULL, /* optional capath to directory with trusted certificates */
NULL /* if randfile!=NULL: use a file with random data to seed randomness */
))
{
soap_print_fault(&soap, stderr);
exit(1);
}
if(soap_call___ns2__Add(&soap,"https://localhost:8443/TestWebService/services/AddService.AddServiceHttpsSoap11Endpoint", NULL,&add, &resp)!= 0)
soap_print_fault(&soap, stderr);
当我执行程序时,我得到了这个消息:
错误 30 错误:SOAP-ENV:Server [no subcode] "SSL error" 详细信息:不能 读取CA文件和目录
当我阅读时,我觉得我必须生成一些文件(.pem、certs...)。
这是我第一次使用 goap 和 ssl,我该如何解决这个问题?
我使用 Windows(因为我发现的所有示例都是针对 linux 的)
【问题讨论】:
标签: c++ windows ssl-certificate client-certificates gsoap