eidheim / Simple-Web-Server

A very simple, fast, multithreaded, platform independent HTTP and HTTPS server and client library implemented using C++11 and Boost.Asio. Created to be an easy way to make REST resources available from C++ applications.
MIT License
2.61k stars 751 forks source link

C2039 'tlsv12': is not a member of 'boost::asio::ssl::context' server_https.hpp #222

Open imvishnu83 opened 6 years ago

imvishnu83 commented 6 years ago

We get an error in

Server(const std::string& cert_file, const std::string& private_key_file, const std::string& verify_file=std::string()): ServerBase::ServerBase(443), context(boost::asio::ssl::context::tlsv12) { context.use_certificate_chain_file(cert_file); context.use_private_key_file(private_key_file, boost::asio::ssl::context::pem);

        if(verify_file.size()>0) {
            context.load_verify_file(verify_file);
            context.set_verify_mode(boost::asio::ssl::verify_peer | boost::asio::ssl::verify_fail_if_no_peer_cert |
                                    boost::asio::ssl::verify_client_once);
            set_session_id_context=true;
        }
    }

we get four error

  1. function "boost::asio::ssl::context::context(const boost::asio::ssl::context &)" (declared implicitly) cannot be referenced -- it is a deleted function server_https.hpp

  2. class "boost::asio::ssl::context" has no member "tlsv12" server_https.hpp

  3. 'tlsv12': is not a member of 'boost::asio::ssl::context' server_https.hpp

  4. 'tlsv12': undeclared identifier server_https.hpp

eidheim commented 6 years ago

What OS are you on, and what OpenSSL/Boost version are you using?

imvishnu83 commented 6 years ago

Hi

I am using openssl-1.0.1u-vs2008 and boost_1_53_0, in Windows 10

eidheim commented 6 years ago

I would try to upgrade both openssl and boost first, if you have that possibility?

imvishnu83 commented 6 years ago

i will try many possiblity, please tell us which version perfectly working for both , so that we can download those version, we had try latest version OpenSSL 1.1.1 pre5, Boost 1.67 also

eidheim commented 6 years ago

I guess the latest openssl and boost versions, as long as they compile on Windows, should be ok. Let me know how it goes:)

imvishnu83 commented 6 years ago

its gives errors: Severity Code Description Project File Line Suppression State Error C2825 'Str': must be a class or namespace when followed by '::' c:\boost\property_tree\detail\xml_parser_writer_settings.hpp Project File Line Suppression State Error C2825 'Str': must be a class or namespace when followed by '::' c:\boost\property_tree\detail\xml_parser_writer_settings.hpp

around 13 error in xml_parser_writer_settings.hpp

eidheim commented 6 years ago

Since I do not use Windows, I cannot help with compiling openssl/boost on Windows sorry.

Hale-Lee commented 6 years ago

what kind's of openssl version you need, I compiled with same error . My OS is centos 7.0, openssl version is OpenSSL 1.0.2o 27 Mar 2018