Skip to content

Commit

Permalink
fix communcation using tls (primihub#776)
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenix20162016 authored May 23, 2024
1 parent 3976c17 commit daea4dd
Show file tree
Hide file tree
Showing 11 changed files with 174 additions and 15 deletions.
8 changes: 4 additions & 4 deletions config/node0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ location: "127.0.0.1"
use_tls: false
grpc_port: 50050

#certificate:
# root_ca: "data/cert/ca.crt"
# key: "data/cert/node0.key"
# cert: "data/cert/node0.crt"
# certificate:
# root_ca: "data/cert/ca.crt"
# key: "data/cert/test.key"
# cert: "data/cert/test.crt"

# public_ip_proxy:
# mode: "grpc"
Expand Down
8 changes: 4 additions & 4 deletions config/node1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ grpc_port: 50051
# port: 30004
# use_tls: false

#certificate:
# root_ca: "data/cert/ca.crt"
# key: "data/cert/node0.key"
# cert: "data/cert/node0.crt"
# certificate:
# root_ca: "data/cert/ca.crt"
# key: "data/cert/test.key"
# cert: "data/cert/test.crt"

proxy_server:
mode: "grpc"
Expand Down
9 changes: 4 additions & 5 deletions config/node2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ use_tls: false

grpc_port: 50052

# public_ip_proxy:
# mode: "grpc"
# ip: "127.0.0.1"
# port: 30008
# use_tls: false
# certificate:
# root_ca: "data/cert/ca.crt"
# key: "data/cert/test.key"
# cert: "data/cert/test.crt"

proxy_server:
mode: "grpc"
Expand Down
30 changes: 30 additions & 0 deletions data/cert/ca.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
-----BEGIN CERTIFICATE-----
MIIFITCCAwkCFDZauqVIb8KvvgROSSKLAMEZYMK0MA0GCSqGSIb3DQEBCwUAME0x
CzAJBgNVBAYTAkNOMRAwDgYDVQQIDAdCZWlKaW5nMRAwDgYDVQQHDAdCZWlKaW5n
MQ0wCwYDVQQKDARYaU11MQswCQYDVQQD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Tr/Yt3qFEGgrVtUwi1Em5W6eIl4aCWnaqfC7KY2hlRzOR4T7d3EY+z7P0hlXePY
kLhDdYpedq9e2fYH5foldpqrcc8/79sCswfPOYofwjPlDtl1usS96vnHlJkGuy3F
WJsr8eiW32uDZqxOJnJKwn1hC0OBLymyf2tnUgOTz6A2EGZckCIEEI+/7vuS348c
GJm13CsjZjL63tVp2nZizpDcoA6EtkHMK6eHdqrpCa+Bz3nG3INYasgeVFKNRVXN
NPadm7HB8nEUan+dYUlS3ozed404Od0Z2w1IbU4qwze/YkfxLn9zz6Z0qzP47DuA
EQqk3MBpyANrL+4wU7EH4ZIQJEhLh8ARNu8+Do6dM8zAyE9V39o5BIATt1BFfwYD
oHqAeQaICsUfahI9WmQzCp7FY+8sWL/zk+j4tqlx0CzqTHIlODI750lHQ0xEZ5h1
dusL1DUvgQY7YpT8sOIXs2ADP8J8+naIXKfFlyHBYemDiB5LBUurhGFFFp8oP7Kl
zIFf1imzuBBSE4HMXuHQ666Z+6Ot
-----END CERTIFICATE-----
52 changes: 52 additions & 0 deletions data/cert/ca.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
-----BEGIN PRIVATE KEY-----
MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQCndiK74Xt2SkS+
7C/o02kg7zZq4d20UBuP2NHejPc53wFwLyg8wvos9th3QdS+/huVkW4jGXokQ7po
lXuXMGSrC3Pu93G9ol68j/UYQpZyyyQfOTwqsC1mKnYHUReBioE6EM0jxb1Jv7Qn
yg2nVKDodtpX3yV2lsLis2ui/g7y4nl4xKB+kKu/yZDkH+KZO3/exbVhnpvpPIlj
wwTdbn22oAmUD/tUPCVhV2TzTaYxXVF0lKqfImuku4+sQVtevnBugRyWYki7oMdJ
6pAS1MR+HpaSlYWnvzhD3ydTZDOfydLzQ4yJBYVAe6vwDTxHKWePmcltXl0+3rSa
M1Rp+fb0uZlz86YCmJcrfrE45vvVyxmjW5ngF9JheXqJr117yrDlH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8+Hk333XyWtBiAGEswPRJ
hiJyUcFylOBT1LFqHjk5EfMPBd+cRtzO2TPevjPyAE29v2Cd/UcEqQVJEFmu0IPF
BE1mD6K1sZOLpWGpfnpMsecSvJxuiL31LDzPuLzoC79GzbPaPA3wRKCxIOU4+Nad
PZXFN9gJSI2AuYcrvNj5knTmFd0+JWGrwDKq2evb/vjXxgTNrneCmY9GJdZJihEZ
Stl6CvaurgKjVSFfNyr6/UHppkBCz4nOOzy5PDkQhXpKTaoqdtRrl5qh7avuDK+Z
rSkCggEAW8Z3pS1qVHFkQLmwfsRFgGjdquZ6k5NdHhc6WAU46Si2nlfOtZXlL0ib
IilZKZnWcki9ezk0m4g0E564KLf7HGHGPrPHzaA6ga676Mws3qcXvL+1/Ax6uXwL
CQTXVjThvdCwXIU3pDeekTWsA72QgsBN0qrjEX4JNrchR/1qOR98vHNypjEy5QOS
Ehq075DT4Czin143pN4o2AWM9489G1pDSHWcunVCJkKZ47/8UgoLgiRxhpHI2UtY
E2r/X8tTjqLXiUTZr20eiQtseskWutzbwMBbtJofi1yuYCRO8unvjdB4fG8lEwc0
dYSofi5BmWjCGBTmSHEwPHDw8Y5NnQ==
-----END PRIVATE KEY-----
30 changes: 30 additions & 0 deletions data/cert/test.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
-----BEGIN CERTIFICATE-----
MIIFEjCCAvqgAwIBAgIUQNwKJMNgklNjYqqPznA6pHsHmRowDQYJKoZIhvcNAQEL
BQAwTTELMAkGA1UEBhMCQ04xEDAOBgNVBAgMB0JlaUppbmcxEDAOBgNVBAcMB0Jl
aUppbmcxDTALBgNVBAoMBFhpTXUxCzAJBgNVBAMMAmNhMB4XDTI0MDUyMDA2MjUw
MFoXDTM0MDUxODA2MjUwMFowVDELMAkGA1UEBhMCQ04xEDAOBgNVBAgMB0JlaUpp
bmcxEDAOBgNVBAcMB0JlaUppbmcxDTALBgNVBAoMBFhpTXUxEjAQBgNVBAMMCWxv
Y2FsaG9zdDCCAS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kqqhPhXw0Ka05qLVmwl0Wf6CQJZ
T91utlZEUttIBWAAN0Ptwmn7h+ho82cm8gXG1sHtj0WMzP39j+xJyovKZZ5AilkB
Ui+23y0Y9FHeOrc9oBDN40SB9wZKCKYAx6RvWdas2ezyLC4nyIJsY6FKmmiuerO4
hSgIGD3D/hV/e9Iwck71wAr6Zn9u5irm2ODRsRzAwCTd+ApJIbkUjBjdF+6NIath
7ui2KevXyA1UHWXo2LSjqMP1KMMsZGML/8OWGwBc1lDodol2J+COGSDAbH++mKLZ
OWVdyDWd9irtuI3nCiQ+14IdsSCBLL0WfR87ImwDGESQ4E9CgI9S9YTjwdZqS4Ch
/NtoSnVS
-----END CERTIFICATE-----
28 changes: 28 additions & 0 deletions data/cert/test.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDFlqXWwEOK1arH
7zHDkcZJEtaLohnlKMVL16uI0vRQ9qVIOByfkNf/X8EfCfZ7RqawIlkK+4Rm/10D
Yt4kcbRudtGuhVsq+Fx0716OS1Ed2yQTXaAqVxO9sM6P3D4h1jGmJ+9IJPw1p+ai
uLghQ/76XZ80zVKmoFVMNhbm74OaXBrAcPbgI4S08LJXEJlhYfRJuYsFckCJdmh0
rfFFtagCmfI+NFKdlRcDmAdSCcarvOTv4qwziL1JdUVe8gdj7Qlawre0oALhHl5W
YZCT0HhUBoDfq8QgIcgpEPEXRBd79kCyCcuM3DLg+aMMFsRkQI0RY60OhETtVFYj
But8igGXAgMBAAECggEAF34iyAatIS/oHISFSLOnkp78RmGRgvcsL358RTTmhU0w
zVuVP6hOSO1UKMIbqIBNJ7ULHEICdeftNw6wIJTVDKtGTAyhZdmzeIMmHXS5YiY2
QwfcmBwpWzekn7iNOfhd3TEeA1hualzFEITg/lziJKzcAJWxuuERCJIyepEbdySV
3EokSw9rKhboh8n5lSaZWQ2RZmfIXQZQnAHBHmY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cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ ABSL_FLAG(bool, use_tls, false, "true/false");
ABSL_FLAG(std::vector<std::string>, cert_config,
std::vector<std::string>({
"data/cert/ca.crt",
"data/cert/client.key",
"data/cert/client.crt"}),
"data/cert/test.key",
"data/cert/test.crt"}),
"cert config");

namespace primihub {
Expand Down
3 changes: 3 additions & 0 deletions src/primihub/node/node_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ retcode VMNodeImpl::Init() {
nodelet_ = std::make_shared<Nodelet>(config_file_path_, dataset_service_);
auto link_mode{network::LinkMode::GRPC};
link_ctx_ = network::LinkFactory::createLinkContext(link_mode);
if (node_cfg.use_tls()) {
link_ctx_->initCertificate(server_config.getCertificateConfig());
}
CleanFinishedTaskThread();
CleanTimeoutCachedTaskStatusThread();
CleanFinishedSchedulerWorkerThread();
Expand Down
12 changes: 12 additions & 0 deletions src/primihub/task/semantic/task_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,22 @@ class TaskContext {
TaskContext() {
auto link_mode = primihub::network::LinkMode::GRPC;
link_ctx_ = primihub::network::LinkFactory::createLinkContext(link_mode);
auto& server_config = primihub::ServerConfig::getInstance();
auto& host_cfg = server_config.getServiceConfig();
if (host_cfg.use_tls()) {
LOG(ERROR) << "link_ctx_->initCertificate";
link_ctx_->initCertificate(server_config.getCertificateConfig());
}
}

explicit TaskContext(primihub::network::LinkMode mode) {
link_ctx_ = primihub::network::LinkFactory::createLinkContext(mode);
auto& server_config = primihub::ServerConfig::getInstance();
auto& host_cfg = server_config.getServiceConfig();
if (host_cfg.use_tls()) {
LOG(ERROR) << "link_ctx_->initCertificate";
link_ctx_->initCertificate(server_config.getCertificateConfig());
}
}

void setTaskInfo(const std::string& job_id,
Expand Down
5 changes: 5 additions & 0 deletions src/primihub/task_engine/task_executor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ retcode TaskEngine::InitCommunication() {
using LinkFactory = primihub::network::LinkFactory;
link_mode_ = LinkMode::GRPC;
link_ctx_ = LinkFactory::createLinkContext(link_mode_);
auto& server_config = primihub::ServerConfig::getInstance();
auto& host_cfg = server_config.getServiceConfig();
if (host_cfg.use_tls()) {
link_ctx_->initCertificate(server_config.getCertificateConfig());
}
return retcode::SUCCESS;
}

Expand Down

0 comments on commit daea4dd

Please sign in to comment.