我已经建立了一个gsoap Web服务,并且可以使用。我需要使用SSL。我遵循以下链接中提到的步骤: https://www.genivia.com/doc/guide/html/index.html#serveropenssl 并且我的程序崩溃了:(
Soap文件是使用从soap类继承的'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);
}
答案 0 :(得分:0)
不幸的是,在将Gsoap服务转换为使用SSL之后,我没有删除libgsoap ++并附加libgsoapssl ++。因此应用程序崩溃了:|