From f2612d42dcf994dd1f0340e27881ac1bf3d0d173 Mon Sep 17 00:00:00 2001 From: Eugene Galkin Date: Wed, 17 Nov 2021 20:48:57 +0300 Subject: [PATCH] Implement SSL X.509 certificate authentication --- src/Server/HTTP/HTTPServerRequest.cpp | 1 + src/Server/HTTP/HTTPServerRequest.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/Server/HTTP/HTTPServerRequest.cpp b/src/Server/HTTP/HTTPServerRequest.cpp index db0ccecf46f..1deecbf550d 100644 --- a/src/Server/HTTP/HTTPServerRequest.cpp +++ b/src/Server/HTTP/HTTPServerRequest.cpp @@ -22,6 +22,7 @@ HTTPServerRequest::HTTPServerRequest(ContextPtr context, HTTPServerResponse & re , max_fields_number(context->getSettingsRef().http_max_fields) , max_field_name_size(context->getSettingsRef().http_max_field_name_size) , max_field_value_size(context->getSettingsRef().http_max_field_value_size) + , stream_socket(session.socket()) { response.attachRequest(this); diff --git a/src/Server/HTTP/HTTPServerRequest.h b/src/Server/HTTP/HTTPServerRequest.h index 85fe3a6f80a..fbf7e0890ea 100644 --- a/src/Server/HTTP/HTTPServerRequest.h +++ b/src/Server/HTTP/HTTPServerRequest.h @@ -32,6 +32,8 @@ public: bool isSecure() const { return secure; } + std::string getPeerCertificateCommonName() const; + /// Returns the client's address. const Poco::Net::SocketAddress & clientAddress() const { return client_address; } @@ -55,6 +57,7 @@ private: std::unique_ptr stream; Poco::Net::SocketImpl * socket; + Poco::Net::StreamSocket & stream_socket; Poco::Net::SocketAddress client_address; Poco::Net::SocketAddress server_address;