Cannot initialize a variable of type ‘SSL_METHOD *’ (aka ‘ssl_method_st *’) with an rvalue of type ‘const SSL_METHOD *’ (aka ‘const ssl_method_st *’)

  c++, openssl

In the C++ project when I build it, there get error:

Cannot initialize a variable of type 'SSL_METHOD *' (aka 'ssl_method_st *') with an rvalue of type 'const SSL_METHOD *' (aka 'const ssl_method_st *')

enter image description here

 static SSL_CTX* CreateSSLContext() {
    SSL_METHOD * method = SSLv23_client_method();
    return SSL_CTX_new(method);
  }

when I jump into the definition:
enter image description here

Source: Windows Questions C++

LEAVE A COMMENT