forked from etcd-io/etcd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(server/embed): enforce non-empty client TLS if scheme is https/unixs
Signed-off-by: Gyuho Lee <[email protected]>
- Loading branch information
Showing
3 changed files
with
44 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package embed | ||
|
||
import ( | ||
"net/url" | ||
"testing" | ||
|
||
"go.etcd.io/etcd/client/pkg/v3/transport" | ||
) | ||
|
||
func TestEmptyClientTLSInfo_createMetricsListener(t *testing.T) { | ||
e := &Etcd{ | ||
cfg: Config{ | ||
ClientTLSInfo: transport.TLSInfo{}, | ||
}, | ||
} | ||
|
||
murl := url.URL{ | ||
Scheme: "https", | ||
Host: "localhost:8080", | ||
} | ||
if _, err := e.createMetricsListener(murl); err != errMissingClientTLSInfoForMetricsURL { | ||
t.Fatalf("expected error %v, got %v", errMissingClientTLSInfoForMetricsURL, err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters