Skip to content

Instantly share code, notes, and snippets.

@Subv
Last active July 7, 2018 20:13
Show Gist options
  • Save Subv/47f09665b12c0ec936c327ac94df3082 to your computer and use it in GitHub Desktop.
Save Subv/47f09665b12c0ec936c327ac94df3082 to your computer and use it in GitHub Desktop.
citra HTTPC context draft
struct Proxy {
std::string url;
std::string username;
std::string password;
u16 port;
};
struct BasicAuth {
std::string username;
std::string password;
};
struct RequestHeader {
std::string name;
std::string value;
};
struct PostData {
// TODO(Subv): Support Binary and Raw POST elements.
std::string name;
std::string value;
};
struct ClientCertContext {
u32 handle;
std::vector<u8> certificate;
std::vector<u8> private_key;
};
struct RootCertChain {
struct RootCACert {
u32 handle;
std::vector<u8> certificate;
};
u32 handle;
std::vector<RootCACert> certificates;
};
struct SSLConfig {
static constexpr SSLConfig default_config{};
u32 options;
std::weak_ptr<ClientCertContext> client_cert_ctx;
std::weak_ptr<RootCertChain> root_ca_chain;
};
struct Context {
std::string url;
RequestMethod method;
RequestState state;
boost::optional<Proxy> proxy;
boost::optional<BasicAuth> basic_auth;
SSLConfig ssl_config = SSLConfig::default_config;
u32 socket_buffer_size;
std::vector<RequestHeader> headers;
std::vector<PostData> post_data;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment