diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 2699c0d53d..8f5fdada71 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -40,6 +40,10 @@ Chris O'Gorman (chogorma) Ocedo GmbH Henning Pfeiffer (megaposer) +neXenio GmbH +Patrik Fiedler (xqp) +René Meusel (reneme) + thomasschaub Trimble diff --git a/Release/include/cpprest/details/x509_cert_utilities.h b/Release/include/cpprest/details/x509_cert_utilities.h index f07f20091f..bca584883c 100644 --- a/Release/include/cpprest/details/x509_cert_utilities.h +++ b/Release/include/cpprest/details/x509_cert_utilities.h @@ -16,7 +16,7 @@ #include #include "cpprest/certificate_info.h" -#if defined(__APPLE__) || (defined(ANDROID) || defined(__ANDROID__)) || (defined(_WIN32) && !defined(__cplusplus_winrt) && !defined(_M_ARM) && !defined(CPPREST_EXCLUDE_WEBSOCKETS)) +#if defined(__linux__) || defined(__APPLE__) || (defined(ANDROID) || defined(__ANDROID__)) || (defined(_WIN32) && !defined(__cplusplus_winrt) && !defined(_M_ARM) && !defined(CPPREST_EXCLUDE_WEBSOCKETS)) #if defined(_MSC_VER) #pragma warning(push) @@ -38,6 +38,7 @@ namespace web { namespace http { namespace client { namespace details { using namespace utility; +#if !defined(__linux__) bool is_end_certificate_in_chain(boost::asio::ssl::verify_context &verifyCtx); @@ -49,9 +50,11 @@ bool is_end_certificate_in_chain(boost::asio::ssl::verify_context &verifyCtx); /// Host name from the URI. /// True if verification passed and server can be trusted, false otherwise. bool verify_cert_chain_platform_specific(boost::asio::ssl::verify_context &verifyCtx, const std::string &hostName, const CertificateChainFunction& func = nullptr); - bool verify_X509_cert_chain(const std::vector &certChain, const std::string &hostName, const CertificateChainFunction& func = nullptr); +#endif + + std::vector> get_X509_cert_chain_encoded_data(boost::asio::ssl::verify_context &verifyCtx); }}}} diff --git a/Release/src/http/client/x509_cert_utilities.cpp b/Release/src/http/client/x509_cert_utilities.cpp index ecfe4a58b4..ef8af05f0c 100644 --- a/Release/src/http/client/x509_cert_utilities.cpp +++ b/Release/src/http/client/x509_cert_utilities.cpp @@ -13,7 +13,7 @@ #include "stdafx.h" -#if defined(__APPLE__) || (defined(ANDROID) || defined(__ANDROID__)) || (defined(_WIN32) && !defined(__cplusplus_winrt) && !defined(_M_ARM) && !defined(CPPREST_EXCLUDE_WEBSOCKETS)) +#if defined(__linux__) || defined(__APPLE__) || (defined(ANDROID) || defined(__ANDROID__)) || (defined(_WIN32) && !defined(__cplusplus_winrt) && !defined(_M_ARM) && !defined(CPPREST_EXCLUDE_WEBSOCKETS)) #include "cpprest/details/x509_cert_utilities.h" #include @@ -40,6 +40,8 @@ namespace web { namespace http { namespace client { namespace details { +#if !defined(__linux__) + bool is_end_certificate_in_chain(boost::asio::ssl::verify_context &verifyCtx) { X509_STORE_CTX *storeContext = verifyCtx.native_handle(); @@ -104,6 +106,8 @@ bool verify_cert_chain_platform_specific(boost::asio::ssl::verify_context &verif return verify_result; } +#endif + #if defined(ANDROID) || defined(__ANDROID__) using namespace crossplat;