Skip to content

Commit 959e3f6

Browse files
committed
WL#15524 Patch #3 Use TLS for upgraded transporter
Add the final bit of code into TransporterRegsitry to start TLS before transporter upgrade, and update the MTR test results. The tls_required and tls_off_certs tests will show TLS in use for transporter connections to MGMD. Change-Id: I2683447c02b27e498873fee77e0382c609a477cd
1 parent 93fe0a0 commit 959e3f6

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

mysql-test/suite/ndb_tls/tls_off_certs.result

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ SELECT * FROM ndbinfo.certificates order by Node_id;
22
Node_id Name Expires Serial
33
1 NDB Data Node Mar 2023 19-Apr-2024 B7:15:32:D5:AE:FF:C7:E1:E2
44
2 NDB Data Node Mar 2023 19-Apr-2024 B7:15:32:D5:AE:FF:C7:E1:E2
5+
3 NDB Management Node Mar 2023 19-Apr-2024 20:70:03:B8:BE:5F:C7:FB:A8
56
SELECT node_id, remote_node_id, encrypted from ndbinfo.transporters
67
WHERE status = 'CONNECTED' ORDER BY node_id, remote_node_id;
78
node_id remote_node_id encrypted
89
1 2 0
9-
1 3 0
10+
1 3 1
1011
1 51 0
1112
2 1 0
12-
2 3 0
13+
2 3 1
1314
2 51 0

mysql-test/suite/ndb_tls/tls_required.result

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@ SELECT * FROM ndbinfo.certificates order by Node_id;
22
Node_id Name Expires Serial
33
1 NDB Data Node Mar 2023 19-Apr-2024 B7:15:32:D5:AE:FF:C7:E1:E2
44
2 NDB Data Node Mar 2023 19-Apr-2024 B7:15:32:D5:AE:FF:C7:E1:E2
5+
3 NDB Management Node Mar 2023 19-Apr-2024 20:70:03:B8:BE:5F:C7:FB:A8
56
51 NDB Node Mar 2023 19-Apr-2024 7B:A8:13:FB:D8:42:8E:A3:C9
67
52 NDB Node Mar 2023 19-Apr-2024 7B:A8:13:FB:D8:42:8E:A3:C9
78
SELECT node_id, remote_node_id, encrypted from ndbinfo.transporters
89
WHERE status = 'CONNECTED' ORDER BY node_id, remote_node_id;
910
node_id remote_node_id encrypted
1011
1 2 1
11-
1 3 0
12+
1 3 1
1213
1 51 1
1314
1 52 1
1415
2 1 1
15-
2 3 0
16+
2 3 1
1617
2 51 1
1718
2 52 1
1819
Use test;

mysql-test/suite/ndb_tls/tls_required.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#
2727
SELECT * FROM ndbinfo.certificates order by Node_id;
2828

29-
## Expect 6 encrypted links, plus two unencrypted links to node 3
29+
## Expect 8 encrypted links
3030
#
3131
SELECT node_id, remote_node_id, encrypted from ndbinfo.transporters
3232
WHERE status = 'CONNECTED' ORDER BY node_id, remote_node_id;

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3847,6 +3847,13 @@ NdbSocket TransporterRegistry::connect_ndb_mgmd(NdbMgmHandle *h)
38473847
DBUG_RETURN(NdbSocket()); // an invalid socket, newly created on the stack
38483848
}
38493849

3850+
/* Before converting, try to start TLS. */
3851+
if(m_tls_keys.ctx())
3852+
{
3853+
(void) ndb_mgm_set_ssl_ctx(*h, m_tls_keys.ctx());
3854+
(void) ndb_mgm_start_tls(*h);
3855+
}
3856+
38503857
if (!report_dynamic_ports(*h))
38513858
{
38523859
ndb_mgm_destroy_handle(h);

0 commit comments

Comments
 (0)