Skip to content

Commit 2bcfc4c

Browse files
committed
fix: typos
1 parent 111aa5e commit 2bcfc4c

4 files changed

Lines changed: 41 additions & 41 deletions

File tree

devenv.nix

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -452,65 +452,65 @@ in {
452452
'';
453453

454454
scripts.test-certinfo-tlsendpoint.exec = ''
455-
gum format "## test certinfo tlsEnpoint"
455+
gum format "## test certinfo tlsEndpoint"
456456
./dist/https-wrench certinfo --tls-endpoint repo.os76.xyz:443
457457
'';
458458

459459
scripts.test-certinfo-tlsendpoint-wrong-ca-file.exec = ''
460-
gum format "## test certinfo tlsEnpoint with wrong CA file"
460+
gum format "## test certinfo tlsEndpoint with wrong CA file"
461461
set +o pipefail
462462
./dist/https-wrench certinfo --tls-endpoint repo.os76.xyz:443 --ca-bundle $CAROOT/rootCA.pem 2>&1 | grep 'certificate signed by unknown authority'
463463
'';
464464

465465
scripts.test-certinfo-tlsendpoint-servername.exec = ''
466-
gum format "## test certinfo tlsEnpoint servername"
466+
gum format "## test certinfo tlsEndpoint servername"
467467
./dist/https-wrench certinfo --tls-endpoint repo.os76.xyz:443 --tls-servername www.os76.xyz
468468
'';
469469

470470
scripts.test-certinfo-tlsendpoint-timeout.exec = ''
471-
gum format "## test certinfo tlsEnpoint timeout"
471+
gum format "## test certinfo tlsEndpoint timeout"
472472
set +o pipefail
473473
./dist/https-wrench certinfo --tls-endpoint repo.os76.xyz:344 2>&1 | grep timeout
474474
'';
475475

476476
scripts.test-certinfo-tlsendpoint-malformed.exec = ''
477-
gum format "## test certinfo tlsEnpoint malformed (missing port)"
477+
gum format "## test certinfo tlsEndpoint malformed (missing port)"
478478
set +o pipefail
479479
./dist/https-wrench certinfo --tls-endpoint repo.os76.xyz | grep 'missing port in address'
480480
'';
481481

482482
scripts.test-certinfo-tlsendpoint-insecure.exec = ''
483-
gum format "## test certinfo tlsEnpoint Insecure"
483+
gum format "## test certinfo tlsEndpoint Insecure"
484484
./dist/https-wrench certinfo --tls-endpoint localhost:9443 --tls-insecure | grep 'certificate signed by unknown authority'
485485
'';
486486

487487
scripts.test-certinfo-tlsendpoint-ca-bundle.exec = ''
488-
gum format "## test certinfo tlsEnpoint + ca-bundle"
488+
gum format "## test certinfo tlsEndpoint + ca-bundle"
489489
./dist/https-wrench certinfo --tls-endpoint localhost:9443 --ca-bundle $CAROOT/rootCA.pem
490490
'';
491491

492492
scripts.test-certinfo-tlsendpoint-ca-bundle-ipv4.exec = ''
493-
gum format "## test certinfo IPv4 tlsEnpoint + ca-bundle"
493+
gum format "## test certinfo IPv4 tlsEndpoint + ca-bundle"
494494
./dist/https-wrench certinfo --tls-endpoint 127.0.0.1:9443 --ca-bundle $CAROOT/rootCA.pem
495495
'';
496496

497497
scripts.test-certinfo-tlsendpoint-ca-bundle-ipv6.exec = ''
498-
gum format "## test certinfo IPV6 tlsEnpoint + ca-bundle "
498+
gum format "## test certinfo IPV6 tlsEndpoint + ca-bundle "
499499
./dist/https-wrench certinfo --tls-endpoint [::1]:9443 --ca-bundle $CAROOT/rootCA.pem
500500
'';
501501

502502
scripts.test-certinfo-tlsendpoint-rsa-key-cert.exec = ''
503-
gum format "## test certinfo tlsEnpoint: RSA key + cert"
503+
gum format "## test certinfo tlsEndpoint: RSA key + cert"
504504
./dist/https-wrench certinfo --tls-endpoint localhost:9443 --tls-insecure --tls-servername example.com --key-file $CAROOT/key.pem | grep 'PrivateKey match: true'
505505
'';
506506

507507
scripts.test-certinfo-tlsendpoint-ecdsa-key-cert.exec = ''
508-
gum format "## test certinfo tlsEnpoint: ECDSA key + cert"
508+
gum format "## test certinfo tlsEndpoint: ECDSA key + cert"
509509
./dist/https-wrench certinfo --tls-endpoint localhost:9446 --tls-insecure --tls-servername example.com --key-file $ECDSA_DIR/ecdsa.key | grep 'PrivateKey match: true'
510510
'';
511511

512512
scripts.test-certinfo-tlsendpoint-ed25519-key-cert.exec = ''
513-
gum format "## test certinfo tlsEnpoint: ED25519 key + cert"
513+
gum format "## test certinfo tlsEndpoint: ED25519 key + cert"
514514
./dist/https-wrench certinfo --tls-endpoint localhost:9445 --tls-insecure --tls-servername example.com --key-file $ED25519_DIR/ed25519.key | grep 'PrivateKey match: true'
515515
'';
516516

internal/certinfo/certinfo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func (c *CertinfoConfig) SetTLSEndpoint(hostport string) error {
136136
if hostport != emptyString {
137137
eHost, ePort, err := net.SplitHostPort(hostport)
138138
if err != nil {
139-
return fmt.Errorf("invalid TLS endpoint %q: %w", c.TLSEndpoint, err)
139+
return fmt.Errorf("invalid TLS endpoint %q: %w", hostport, err)
140140
}
141141

142142
c.TLSEndpoint = hostport

internal/certinfo/certinfo_handlers_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func TestCertinfo_GetRemoteCerts(t *testing.T) {
4545
},
4646

4747
{
48-
desc: "Malfomed Server Certificate",
48+
desc: "Malformed Server Certificate",
4949
srvCfg: demoHTTPServerConfig{
5050
serverAddr: "localhost:46303",
5151
serverName: "example.com",
@@ -99,7 +99,7 @@ func TestCertinfo_GetRemoteCerts(t *testing.T) {
9999
expectSrvPort: "46306",
100100
},
101101
{
102-
desc: "IPV6 Enpoint RSA Cert Success",
102+
desc: "IPV6 Endpoint RSA Cert Success",
103103
srvCfg: demoHTTPServerConfig{
104104
serverAddr: "[::1]:46307",
105105
serverName: "example.com",
@@ -290,7 +290,7 @@ func TestCertinfo_PrintData(t *testing.T) {
290290
keyCertMatch: true,
291291
},
292292
{
293-
desc: "local key and remote TLS Enpoint",
293+
desc: "local key and remote TLS Endpoint",
294294
keyFile: RSASampleCertKeyFile,
295295
caCertFile: RSACaCertFile,
296296
keyCertMatch: true,

internal/certinfo/certinfo_test.go

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -327,34 +327,34 @@ func TestCertinfo_SetTLSServerName(t *testing.T) {
327327

328328
func TestCertinfo_SetTLSEndpoint(t *testing.T) {
329329
tests := []struct {
330-
desc string
331-
endpoint string
332-
expectEnpoint string
333-
expectHost string
334-
expectPort string
335-
processErr bool
336-
expectMsg string
330+
desc string
331+
endpoint string
332+
expectEndpoint string
333+
expectHost string
334+
expectPort string
335+
processErr bool
336+
expectMsg string
337337
}{
338338
{
339-
desc: "success",
340-
endpoint: "localhost:443",
341-
expectEnpoint: "localhost:443",
342-
expectHost: "localhost",
343-
expectPort: "443",
339+
desc: "success",
340+
endpoint: "localhost:443",
341+
expectEndpoint: "localhost:443",
342+
expectHost: "localhost",
343+
expectPort: "443",
344344
},
345345
{
346-
desc: "success IPV6",
347-
endpoint: "[::1]:443",
348-
expectEnpoint: "[::1]:443",
349-
expectHost: "::1",
350-
expectPort: "443",
346+
desc: "success IPV6",
347+
endpoint: "[::1]:443",
348+
expectEndpoint: "[::1]:443",
349+
expectHost: "::1",
350+
expectPort: "443",
351351
},
352352
{
353-
desc: "success IPV4",
354-
endpoint: "127.0.0.1:443",
355-
expectEnpoint: "127.0.0.1:443",
356-
expectHost: "127.0.0.1",
357-
expectPort: "443",
353+
desc: "success IPV4",
354+
endpoint: "127.0.0.1:443",
355+
expectEndpoint: "127.0.0.1:443",
356+
expectHost: "127.0.0.1",
357+
expectPort: "443",
358358
},
359359
{
360360
desc: "error malformed host",
@@ -366,7 +366,7 @@ func TestCertinfo_SetTLSEndpoint(t *testing.T) {
366366
desc: "error missing port",
367367
endpoint: "localhost",
368368
processErr: true,
369-
expectMsg: "invalid TLS endpoint \"\": address localhost: missing port in address",
369+
expectMsg: "invalid TLS endpoint \"localhost\": address localhost: missing port in address",
370370
},
371371
{
372372
desc: "error missing host",
@@ -378,7 +378,7 @@ func TestCertinfo_SetTLSEndpoint(t *testing.T) {
378378
desc: "error endpoint includes scheme",
379379
endpoint: "https://localhost:80443",
380380
processErr: true,
381-
expectMsg: "invalid TLS endpoint \"\": address https://localhost:80443: too many colons in address",
381+
expectMsg: "invalid TLS endpoint \"https://localhost:80443\": address https://localhost:80443: too many colons in address",
382382
},
383383
}
384384

@@ -397,7 +397,7 @@ func TestCertinfo_SetTLSEndpoint(t *testing.T) {
397397
// in this case. See tests related to GetRemoteCerts for more
398398

399399
// require.NoError(t, err)
400-
require.Equal(t, tt.expectEnpoint, cc.TLSEndpoint, "check TLSEndpoint")
400+
require.Equal(t, tt.expectEndpoint, cc.TLSEndpoint, "check TLSEndpoint")
401401
require.Equal(t, tt.expectHost, cc.TLSEndpointHost, "check TLSEndpointHost")
402402
require.Equal(t, tt.expectPort, cc.TLSEndpointPort, "check TLSEndpointPort")
403403

0 commit comments

Comments
 (0)