MCPcopy Create free account
hub / github.com/ByConity/ByConity / establishSecureConnection

Method establishSecureConnection

src/Server/PostgreSQLHandler.cpp:177–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175}
176
177void PostgreSQLHandler::establishSecureConnection(Int32 & payload_size, Int32 & info)
178{
179 bool was_encryption_req = true;
180 readBinaryBigEndian(payload_size, *in);
181 readBinaryBigEndian(info, *in);
182
183 switch (static_cast<PostgreSQLProtocol::Messaging::FrontMessageType>(info))
184 {
185 case PostgreSQLProtocol::Messaging::FrontMessageType::SSL_REQUEST:
186 LOG_DEBUG(log, "Client requested SSL");
187 if (ssl_enabled)
188 makeSecureConnectionSSL();
189 else
190 message_transport->send('N', true);
191 break;
192 case PostgreSQLProtocol::Messaging::FrontMessageType::GSSENC_REQUEST:
193 LOG_DEBUG(log, "Client requested GSSENC");
194 message_transport->send('N', true);
195 break;
196 default:
197 was_encryption_req = false;
198 }
199 if (was_encryption_req)
200 {
201 readBinaryBigEndian(payload_size, *in);
202 readBinaryBigEndian(info, *in);
203 }
204}
205
206#if USE_SSL
207void PostgreSQLHandler::makeSecureConnectionSSL()

Callers

nothing calls this directly

Calls 2

readBinaryBigEndianFunction · 0.85
sendMethod · 0.45

Tested by

no test coverage detected