azure-core
Loading...
Searching...
No Matches
win_http_transport.hpp
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
9#pragma once
10
15#include "azure/core/internal/unique_handle.hpp"
17#include "azure/core/url.hpp"
18
19#include <memory>
20#include <string>
21#include <vector>
22
23namespace Azure { namespace Core { namespace Http {
24 namespace _detail {
25 class WinHttpRequest;
26 }
27
33 {
38
43
58
63
76 std::string ProxyInformation;
77
82
87
93 std::vector<std::string> ExpectedTlsRootCertificates;
94 };
95
101 private:
102 WinHttpTransportOptions m_options;
103 // m_sessionhandle is const to ensure immutability.
104 const Azure::Core::_internal::UniqueHandle<void*> m_sessionHandle;
105
106 Azure::Core::_internal::UniqueHandle<void*> CreateSessionHandle();
107 Azure::Core::_internal::UniqueHandle<void*> CreateConnectionHandle(
108 Azure::Core::Url const& url,
109 Azure::Core::Context const& context);
110
111 std::unique_ptr<_detail::WinHttpRequest> CreateRequestHandle(
112 Azure::Core::_internal::UniqueHandle<void*> const& connectionHandle,
113 Azure::Core::Url const& url,
114 Azure::Core::Http::HttpMethod const& method);
115
116 // Callback to allow a derived transport to extract the request handle. Used for WebSocket
117 // transports.
118 virtual void OnUpgradedConnection(std::unique_ptr<_detail::WinHttpRequest> const&){};
119
120 public:
127
138
144 virtual std::unique_ptr<RawResponse> Send(Request& request, Context const& context) override;
145
146 // See also:
147 // [Core Guidelines C.35: "A base class destructor should be either public
148 // and virtual or protected and
149 // non-virtual"](http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c35-a-base-class-destructor-should-be-either-public-and-virtual-or-protected-and-non-virtual)
150 virtual ~WinHttpTransport();
151 };
152
153}}} // namespace Azure::Core::Http
A context is a node within a unidirectional tree that represents deadlines and key/value pairs.
Definition context.hpp:72
The method to be performed on the resource identified by the Request.
Definition http.hpp:94
Base class for all HTTP transport implementations.
Definition transport.hpp:22
A request message from a client to a server.
Definition http.hpp:182
Concrete implementation of an HTTP transport that uses WinHTTP when sending and receiving requests an...
Definition win_http_transport.hpp:100
virtual std::unique_ptr< RawResponse > Send(Request &request, Context const &context) override
Implements the HTTP transport interface to send an HTTP Request and produce an HTTP RawResponse.
Definition win_http_transport.cpp:1440
Represents the location where a request will be performed.
Definition url.hpp:46
Manages an optional contained value, i.e. a value that may or may not be present.
Definition nullable.hpp:30
Context for canceling long running operations.
HTTP request and response functionality.
Compute the hash value for the input binary data, using SHA256, SHA384 and SHA512.
Definition azure_assert.hpp:57
Manages an optional contained value, i.e. a value that may or may not be present.
HTTP transport policies, and their options.
HTTP transport options parameterize the HTTP transport adapter being used.
Definition policy.hpp:162
Sets the WinHTTP session and connection options used to customize the behavior of the transport.
Definition win_http_transport.hpp:33
bool EnableCertificateRevocationListCheck
If True, enables checks for certificate revocation.
Definition win_http_transport.hpp:62
std::vector< std::string > ExpectedTlsRootCertificates
Array of Base64 encoded DER encoded X.509 certificate. These certificates should form a chain of cert...
Definition win_http_transport.hpp:93
bool IgnoreUnknownCertificateAuthority
When true, allows an invalid certificate authority.
Definition win_http_transport.hpp:37
bool EnableSystemDefaultProxy
If True, enables the use of the system default proxy.
Definition win_http_transport.hpp:57
bool IgnoreInvalidCertificateCommonName
When true, allows an invalid common name in a certificate.
Definition win_http_transport.hpp:42
Azure::Nullable< std::string > ProxyUserName
User name for proxy authentication.
Definition win_http_transport.hpp:81
std::string ProxyInformation
Proxy information.
Definition win_http_transport.hpp:76
Azure::Nullable< std::string > ProxyPassword
Password for proxy authentication.
Definition win_http_transport.hpp:86
Utilities to be used by HTTP transport implementations.
Uniform Resource Locator (URL).