首页 文章

c - 无法使用HTTPS访问gSOAP Web服务

提问于
浏览
0

我正在尝试使用gSOAP 2.8.4上的SSL构建的Web服务 . 但它不起作用 . 相关信息:

  • 使用HTTP一切正常 . 问题只发生在使用HTTPS时 .

  • 消息错误:

错误-1错误:SOAP-ENV:客户端[无子代码]“文件结束或无输入:操作中断或超时(60秒接收延迟)(60秒发送延迟)”详细信息:[无详细信息]

问题似乎不是低超时,因为错误是瞬时的 .

服务器环境:

if (soap_ssl_server_context(&soap,
    SOAP_SSL_DEFAULT,   /* use SOAP_SSL_REQUIRE_CLIENT_AUTHENTICATION to verify clients: client must provide a key file e.g. "client.pem" and "password" */
    "server.pem",   /* keyfile (cert+key): see SSL docs to create this file */
    password,       /* password to read the private key in the key file */
    "cacert.pem",   /* cacert file to store trusted certificates (to authenticate clients) */
    "./",       /* capath */
    NULL,   /* DH file name or DH param key len bits (e.g. "1024"), if NULL use RSA 2048 bits (SOAP_SSL_RSA_BITS) */
    NULL,       /* if randfile!=NULL: use a file with random data to seed randomness */
    "server"        /* server identification for SSL session cache (unique server name, e.g. use argv[0]) */
    ))
{

客户背景:

if (soap_ssl_client_context(&soap,
    SOAP_SSL_DEFAULT,   /* use SOAP_SSL_DEFAULT in production code */
    NULL,       /* keyfile (cert+key): required only when client must authenticate to server (see SSL docs to create this file) */
    NULL,       /* password to read the keyfile */
    "cacert.pem",   /* optional cacert file to store trusted certificates, use cacerts.pem for all public certificates issued by common CAs */
    "./",       /* optional capath to directory with trusted certificates */
    NULL        /* if randfile!=NULL: use a file with random data to seed randomness */
    ))
{

所有证书和密码都是正确的 . 可能是什么问题呢?


编辑:我用-DDEBUG编译了代码 . 这出现在TEST.log中

免费ID哈希表从socket = 4 / fd = 0读取0个字节发送回错误代码的错误代码-1 soap_instantiate_SOAP_ENV__Fault(-1 ,,)

1 回答

  • 0

    我已经解决了这个问题 . 服务器证书错了 . 此应用程序中的公用名称应等于主机名 .

相关问题