在 soap_ssl_server_context(..) 中使用继承时 gsoap 中的分段错误

Segmentation fault in gsoap when use inheritance in soap_ssl_server_context(...)

本文关键字:继承 gsoap 错误 分段 server ssl context soap      更新时间:2023-10-16

我已经建立了一个gsoap Web服务,它可以工作。我需要使用SSL。我按照以下链接中提到的步骤进行操作:https://www.genivia.com/doc/guide/html/index.html#serveropenssl我的程序崩溃了:(

肥皂文件是使用从肥皂类继承的"soapcpp2 -i"开关生成的。

我的 QT .pro 文件:

...
LIBS += -lgsoapssl++ -lssl -lcrypto
QMAKE_CXXFLAGS += -DWITH_OPENSSL
...

最后,即使所有参数都使用 NULL 参数,我的程序在以下函数"soap_ssl_server_context"时崩溃。

  if (soap_ssl_server_context(soap, 
    SOAP_SSL_DEFAULT, 
    "server.pem",      /* keyfile: required when server must authenticate to clients (see SSL docs on how to obtain this file) */ 
    "password",        /* password to read the key file (not used with GNUTLS) */ 
    "cacert.pem",      /* optional cacert file to store trusted certificates */ 
    NULL,              /* optional capath to directory with trusted certificates */ 
    "dh512.pem",       /* DH file name or DH key len bits (minimum is 512, e.g. "512") to generate DH param, if NULL use RSA */ 
    NULL,              /* if randfile!=NULL: use a file with random data to seed randomness */  
    NULL               /* optional server identification to enable SSL session caching to speed up TLS (must be a unique name) */
  )) 
  {
    soap_print_fault(soap, stderr); 
    exit(EXIT_FAILURE); 
  } 

不幸的是,在我将 Gsoap 服务转换为使用 SSL 后,我没有删除 libgsoap++ 并附加 libgsoapssl++。所以应用程序崩溃了:|