curl-fuzzer C++ reference
Loading...
Searching...
No Matches
h2_proxy_mock_server.h
Go to the documentation of this file.
1/*
2 * Copyright (C) Max Dymond, <cmeister2@gmail.com>, et al.
3 *
4 * SPDX-License-Identifier: curl
5 */
6
9
10#ifndef PROTO_FUZZER_H2_PROXY_MOCK_SERVER_H_
11#define PROTO_FUZZER_H2_PROXY_MOCK_SERVER_H_
12
14
15namespace proto_fuzzer {
16
24
31 public:
33 curl::fuzzer::proto::ProxyProtocol protocol = curl::fuzzer::proto::PROXY_PROTOCOL_HTTP2);
34 ~H2ProxyMockServer() override = default;
35
36 H2ProxyMockServer(const H2ProxyMockServer&) = delete;
37 H2ProxyMockServer& operator=(const H2ProxyMockServer&) = delete;
38
39 void Install(CURL* easy) override;
40
41 const std::string& client_transcript() const;
42
43 protected:
44 std::unique_ptr<MockConnection> CreateConnection() override;
45
46 private:
47 void ObserveIncomingData(const unsigned char* data, std::size_t size) override;
48
49 H2ProxyMode mode_;
50 curl::fuzzer::proto::ProxyProtocol protocol_;
51 std::string client_transcript_;
52};
53
54} // namespace proto_fuzzer
55
56#endif // PROTO_FUZZER_H2_PROXY_MOCK_SERVER_H_
H2ProxyMockServer(H2ProxyMode mode=H2ProxyMode::kTunnel, curl::fuzzer::proto::ProxyProtocol protocol=curl::fuzzer::proto::PROXY_PROTOCOL_HTTP2)
Select the closed proxy protocol profile before any connection opens.
void Install(CURL *easy) override
Install the socket transport and force one verified HTTPS proxy.
const std::string & client_transcript() const
std::unique_ptr< MockConnection > CreateConnection() override
Attach a bounded observer after TLS decoding so tests can verify the real CONNECT request rather than...
Receives bytes after any transport decoding.
TlsMockServer()
Build one reusable in-process server context per fuzz iteration.
H2ProxyMode
Origin-request shape carried by the fixed HTTPS/HTTP2 proxy transport.
@ kForward
Submit an absolute-form origin request directly as an HTTP/2 stream.
@ kTunnel
Establish CONNECT, then carry a plaintext HTTP/1.1 origin exchange.
Reusable TLS transport for structured in-process protocol peers.