Implement SSL X.509 certificate authentication

This commit is contained in:
Eugene Galkin 2021-11-17 20:48:57 +03:00
parent f46dca4793
commit f2612d42dc
2 changed files with 4 additions and 0 deletions

View File

@ -22,6 +22,7 @@ HTTPServerRequest::HTTPServerRequest(ContextPtr context, HTTPServerResponse & re
, max_fields_number(context->getSettingsRef().http_max_fields) , max_fields_number(context->getSettingsRef().http_max_fields)
, max_field_name_size(context->getSettingsRef().http_max_field_name_size) , max_field_name_size(context->getSettingsRef().http_max_field_name_size)
, max_field_value_size(context->getSettingsRef().http_max_field_value_size) , max_field_value_size(context->getSettingsRef().http_max_field_value_size)
, stream_socket(session.socket())
{ {
response.attachRequest(this); response.attachRequest(this);

View File

@ -32,6 +32,8 @@ public:
bool isSecure() const { return secure; } bool isSecure() const { return secure; }
std::string getPeerCertificateCommonName() const;
/// Returns the client's address. /// Returns the client's address.
const Poco::Net::SocketAddress & clientAddress() const { return client_address; } const Poco::Net::SocketAddress & clientAddress() const { return client_address; }
@ -55,6 +57,7 @@ private:
std::unique_ptr<ReadBuffer> stream; std::unique_ptr<ReadBuffer> stream;
Poco::Net::SocketImpl * socket; Poco::Net::SocketImpl * socket;
Poco::Net::StreamSocket & stream_socket;
Poco::Net::SocketAddress client_address; Poco::Net::SocketAddress client_address;
Poco::Net::SocketAddress server_address; Poco::Net::SocketAddress server_address;