Skip to content

Commit a96f9f4

Browse files
committed
WL#15135 patch #3: add TlsKeyManager to TransporterRegistry
Part of WL#15135 Certificate Architecture This patch adds an instance of TlsKeyManager to class TransporterRegistry. This TlsKeyManager will handle certificate authentication in all node types. A new method TransporterRegistry::init_tls() configures TLS at node startup time. Change-Id: I1f9d3fff21ea7f2d9f009cce48823304c2baead7
1 parent a6c1b92 commit a96f9f4

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

storage/ndb/include/transporter/TransporterRegistry.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
#include "portlib/NdbTick.h"
5555
#include "portlib/ndb_sockaddr.h"
5656
#include "util/NdbSocket.h"
57+
#include "util/TlsKeyManager.hpp"
5758

5859
#ifndef _WIN32
5960
/*
@@ -233,6 +234,12 @@ class TransporterRegistry
233234
*/
234235
bool init(TransporterReceiveHandle&);
235236

237+
/**
238+
* Initialize TLS context. Cannot be called prior to init(NodeId).
239+
* Returns true on success.
240+
*/
241+
bool init_tls(const char * search_path, int node_type, bool is_primary);
242+
236243
/**
237244
Perform handshaking of a client connection to accept it
238245
as transporter.
@@ -568,6 +575,7 @@ class TransporterRegistry
568575
Uint32 nMultiTransporters;
569576
Uint32 nTCPTransporters;
570577
Uint32 nSHMTransporters;
578+
TlsKeyManager m_tls_keys;
571579

572580
#ifdef ERROR_INSERT
573581
NodeBitmask m_blocked;

storage/ndb/src/common/transporter/TransporterRegistry.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,15 @@ TransporterRegistry::init(TransporterReceiveHandle& recvhandle)
488488
return recvhandle.init(maxTransporters);
489489
}
490490

491+
bool
492+
TransporterRegistry::init_tls(const char * searchPath, int nodeType,
493+
bool isPrimary)
494+
{
495+
require(localNodeId);
496+
m_tls_keys.init(searchPath, localNodeId, nodeType, isPrimary);
497+
return m_tls_keys.ctx();
498+
}
499+
491500
bool
492501
TransporterRegistry::connect_server(NdbSocket & socket,
493502
BaseString & msg,

0 commit comments

Comments
 (0)