how to use SSL in C++ gSOAP generated classes

前端 未结 4 2114
眼角桃花
眼角桃花 2021-02-15 13:31

i need to use gsoap library in C++ and i need to use https. documentation says how to work with HTTPS in C, but not in C++ (http://www.cs.fsu.edu/~engelen/soapdoc2.html#tth_sEc1

4条回答
  •  心在旅途
    2021-02-15 13:40

    i've solved this trouble by myself. but it's quirky, very quirky way. gSOAP generates C++ classes inherited from struct soap, it contains following attrs:

    BIO *bio;
    SSL *ssl;
    SSL_CTX *ctx;
    unsigned short ssl_flags;
    const char *keyfile;
    const char *password;
    const char *dhfile;
    const char *cafile;
    const char *capath;
    const char *crlfile;
    const char *randfile;
    SSL_SESSION *session;
    

    so we can setup necessary attrs (flags, params) as in OpenSSL library by ourselves. In simple case it's enough to call soap_ssl_init() once and set ssl_flags = SOAP_SSL_NO_AUTHENTICATION. it works for me. if anyone knows better way i'll gla

提交回复
热议问题