Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
comms
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
xx network
comms
Commits
7069001c
Commit
7069001c
authored
Dec 15, 2022
by
Jonah Husson
Browse files
Options
Downloads
Patches
Plain Diff
Move web host check to newHost from setCredentials
parent
88011180
No related branches found
No related tags found
2 merge requests
!55
Use withsecure for tls, don't pass cert
,
!39
Merge release into master
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
connect/host.go
+7
-8
7 additions, 8 deletions
connect/host.go
with
7 additions
and
8 deletions
connect/host.go
+
7
−
8
View file @
7069001c
...
...
@@ -116,11 +116,13 @@ func newHost(id *id.ID, address string, cert []byte, params HostParams) (host *H
host
.
UpdateAddress
(
address
)
// Configure the host credentials
// Configure the transport credentials for GRPC hosts
if
!
host
.
IsWeb
()
{
err
=
host
.
setCredentials
()
if
err
!=
nil
{
return
}
}
// Connect immediately if configured to do so
if
params
.
DisableLazyConnection
{
...
...
@@ -331,14 +333,11 @@ func (h *Host) disconnect() {
h
.
transmissionToken
.
Clear
()
}
// setCredentials sets TransportCredentials and RSA PublicKey objects
// setCredentials sets
GRPC
TransportCredentials and RSA PublicKey objects
// using a PEM-encoded TLS Certificate
func
(
h
*
Host
)
setCredentials
()
error
{
// If no TLS Certificate specified, print a warning and do nothing
if
h
.
IsWeb
()
{
return
nil
}
if
h
.
certificate
==
nil
||
len
(
h
.
certificate
)
==
0
{
if
TestingOnlyDisableTLS
{
jww
.
WARN
.
Printf
(
"No TLS Certificate specified!"
)
...
...
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