Expose computed tls_ca config

Provide the loaded file of the tls_ca config available to slave,
instance and ctl code.  This ensures they can easily use it when
connecting to the master server.
This commit is contained in:
Hornwitser committed 2021-03-01 15:03:25 +01:00
1 parent 6a29cd9715
commit 4efd09de31
2 files changed
+16 -5

No files matched your search

+7 -2
View File
@@ -698,10 +698,15 @@ class ControlConnector extends libLink.WebSocketClientConnector {
*/
class Control extends libLink.Link {
constructor(connector, controlPlugins) {
constructor(connector, tlsCa, controlPlugins) {
super("control", "master", connector);
libLink.attachAllMessages(this);
/**
* Certificate authority used to validate TLS connections to the master.
* @type {?string}
*/
this.tlsCa = tlsCa;
/**
* Mapping of plugin names to their instance for loaded plugins.
* @type {Map<string, module:lib/plugin.BaseControlPlugin>}
@@ -917,7 +922,7 @@ async function startControl() {
tlsCa,
controlConfig.get("control.master_token")
);
let control = new Control(controlConnector, controlPlugins);
let control = new Control(controlConnector, tlsCa, controlPlugins);
try {
await controlConnector.connect();
} catch (err) {