【问题标题】:gsoap Reading CA file, Windowsgsoap 读取 CA 文件,Windows
【发布时间】: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


    【解决方案1】:

    问题与我的 C++ 客户端代码无关。事实上,我必须将服务器认证文件添加到位于我的 jre 中的 Bin\security\cacerts 文件中。

    我不得不尝试实现一个 Java 客户端来理解这个问题。

    【讨论】:

      猜你喜欢
      • 2010-09-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-15
      • 2015-01-12
      • 2018-08-25
      • 1970-01-01
      相关资源
      最近更新 更多