mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-01 03:52:15 +00:00
b79ead9c84
* Replicate poco into base/poco/ * De-register poco submodule * Build poco from ClickHouse * Exclude poco from stylecheck * Exclude poco from whitespace check * Exclude poco from typo check * Remove x bit from sources/headers (the style check complained) * Exclude poco from duplicate include check * Fix fasttest * Remove contrib/poco-cmake/* * Simplify poco build descriptions * Remove poco stuff not used by ClickHouse * Glob poco sources * Exclude poco from clang-tidy
84 lines
2.1 KiB
C++
84 lines
2.1 KiB
C++
//
|
|
// HTTPSStreamFactory.h
|
|
//
|
|
// Library: NetSSL_OpenSSL
|
|
// Package: HTTPSClient
|
|
// Module: HTTPSStreamFactory
|
|
//
|
|
// Definition of the HTTPSStreamFactory class.
|
|
//
|
|
// Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH.
|
|
// and Contributors.
|
|
//
|
|
// SPDX-License-Identifier: BSL-1.0
|
|
//
|
|
|
|
|
|
#ifndef NetSSL_HTTPSStreamFactory_INCLUDED
|
|
#define NetSSL_HTTPSStreamFactory_INCLUDED
|
|
|
|
|
|
#include "Poco/Net/NetSSL.h"
|
|
#include "Poco/Net/HTTPSession.h"
|
|
#include "Poco/URIStreamFactory.h"
|
|
|
|
|
|
namespace Poco {
|
|
namespace Net {
|
|
|
|
|
|
class NetSSL_API HTTPSStreamFactory: public Poco::URIStreamFactory
|
|
/// An implementation of the URIStreamFactory interface
|
|
/// that handles secure Hyper-Text Transfer Protocol (https) URIs.
|
|
{
|
|
public:
|
|
HTTPSStreamFactory();
|
|
/// Creates the HTTPSStreamFactory.
|
|
|
|
HTTPSStreamFactory(const std::string& proxyHost, Poco::UInt16 proxyPort = HTTPSession::HTTP_PORT);
|
|
/// Creates the HTTPSStreamFactory.
|
|
///
|
|
/// HTTPS connections will use the given proxy.
|
|
|
|
HTTPSStreamFactory(const std::string& proxyHost, Poco::UInt16 proxyPort, const std::string& proxyUsername, const std::string& proxyPassword);
|
|
/// Creates the HTTPSStreamFactory.
|
|
///
|
|
/// HTTPS connections will use the given proxy and
|
|
/// will be authorized against the proxy using Basic authentication
|
|
/// with the given proxyUsername and proxyPassword.
|
|
|
|
~HTTPSStreamFactory();
|
|
/// Destroys the HTTPSStreamFactory.
|
|
|
|
std::istream* open(const Poco::URI& uri);
|
|
/// Creates and opens a HTTPS stream for the given URI.
|
|
/// The URI must be a https://... URI.
|
|
///
|
|
/// Throws a NetException if anything goes wrong.
|
|
|
|
static void registerFactory();
|
|
/// Registers the HTTPSStreamFactory with the
|
|
/// default URIStreamOpener instance.
|
|
|
|
static void unregisterFactory();
|
|
/// Unregisters the HTTPSStreamFactory with the
|
|
/// default URIStreamOpener instance.
|
|
|
|
private:
|
|
enum
|
|
{
|
|
MAX_REDIRECTS = 10
|
|
};
|
|
|
|
std::string _proxyHost;
|
|
Poco::UInt16 _proxyPort;
|
|
std::string _proxyUsername;
|
|
std::string _proxyPassword;
|
|
};
|
|
|
|
|
|
} } // namespace Poco::Net
|
|
|
|
|
|
#endif // Net_HTTPSStreamFactory_INCLUDED
|