Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dCache
cta
Commits
9d96720c
Commit
9d96720c
authored
3 years ago
by
Tigran Mkrtchyan
Browse files
Options
Downloads
Patches
Plain Diff
cta-dcache: log used TLS options on startup
parent
197224ef
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cta-dcache/Main.cpp
+18
-3
18 additions, 3 deletions
cta-dcache/Main.cpp
with
18 additions
and
3 deletions
cta-dcache/Main.cpp
+
18
−
3
View file @
9d96720c
...
...
@@ -154,16 +154,31 @@ int main(const int argc, char *const *const argv) {
std
::
shared_ptr
<
grpc
::
ServerCredentials
>
creds
;
if
(
useTLS
)
{
lc
.
log
(
log
::
INFO
,
"Using gRPC over TLS"
);
grpc
::
SslServerCredentialsOptions
tls_options
;
grpc
::
SslServerCredentialsOptions
::
PemKeyCertPair
cert
;
cert
.
private_key
=
file2string
(
config
.
getConfEntString
(
"gRPC"
,
"TlsKey"
));
cert
.
cert_chain
=
file2string
(
config
.
getConfEntString
(
"gRPC"
,
"TlsCert"
));
tls_options
.
pem_root_certs
=
file2string
(
config
.
getConfEntString
(
"gRPC"
,
"TlsChain"
));
auto
key_file
=
config
.
getConfEntString
(
"gRPC"
,
"TlsKey"
);
lc
.
log
(
log
::
INFO
,
"TLS service key file: "
+
key_file
);
cert
.
private_key
=
file2string
(
key_file
);
auto
cert_file
=
config
.
getConfEntString
(
"gRPC"
,
"TlsCert"
);
lc
.
log
(
log
::
INFO
,
"TLS service certificate file: "
+
cert_file
);
cert
.
cert_chain
=
file2string
(
cert_file
);
auto
ca_chain
=
config
.
getConfEntString
(
"gRPC"
,
"TlsChain"
,
""
);
if
(
!
ca_chain
.
empty
())
{
lc
.
log
(
log
::
INFO
,
"TLS CA chain file: "
+
ca_chain
);
tls_options
.
pem_root_certs
=
file2string
(
cert_file
);
}
else
{
lc
.
log
(
log
::
INFO
,
"TLS CA chain file not defined ..."
);
tls_options
.
pem_root_certs
=
""
;
}
tls_options
.
pem_key_cert_pairs
.
emplace_back
(
std
::
move
(
cert
));
creds
=
grpc
::
SslServerCredentials
(
tls_options
);
}
else
{
lc
.
log
(
log
::
INFO
,
"Using gRPC over plaintext socket"
);
creds
=
grpc
::
InsecureServerCredentials
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment