Skip to content
This repository was archived by the owner on Apr 22, 2024. It is now read-only.

Commit e2d24e2

Browse files
committed
small nits
1 parent c96e2e2 commit e2d24e2

File tree

2 files changed

+13
-57
lines changed

2 files changed

+13
-57
lines changed

DEVELOPMENT.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,6 @@ The following software and tools are needed to build the project and run the tes
1515
* [Helm](https://helm.sh/docs/intro/install/) (needed to run the Istio e2e test suite)
1616

1717

18-
## Generating the API code
19-
20-
The configuration options are defined in the [config](config/) directory using [Protocol Buffers](https://protobuf.dev/).
21-
To generate the configuration API code after doing changes to the `.proto` files, run:
22-
23-
```bash
24-
$ make generate
25-
```
26-
27-
There is no need to run `generate` after checking out the code; it's only needed when changes are made to
28-
the `.proto` files.
29-
30-
3118
## Building the binary
3219

3320
To build the binary simply run:
@@ -59,6 +46,19 @@ You can use the `DOCKER_TARGETS` environment variable to control the operating s
5946
you want to build the Docker images for.
6047

6148

49+
## Generating the API code
50+
51+
The configuration options are defined in the [config](config/) directory using [Protocol Buffers](https://protobuf.dev/).
52+
To generate the configuration API code after doing changes to the `.proto` files, run:
53+
54+
```bash
55+
$ make generate
56+
```
57+
58+
There is no need to run `generate` after checking out the code; it's only needed when changes are made to
59+
the `.proto` files.
60+
61+
6262
## Testing
6363

6464
The main testing targets are:

e2e/testclient.go

-44
Original file line numberDiff line numberDiff line change
@@ -390,47 +390,3 @@ func (m firstFormMatcher) matches(n *html.Node) bool {
390390
func (m firstFormMatcher) String() string {
391391
return "first form"
392392
}
393-
394-
// NewSkipHostnameVerificationConfig returns a TLS configuration that
395-
// doesn't perform the default certificate verification because it
396-
// will verify the hostname. Instead, it verifies the server's
397-
// certificate chain in VerifyPeerCertificate and ignores the server
398-
// name.
399-
//
400-
// See https://github.com/golang/go/issues/21971#issuecomment-332693931
401-
// and https://pkg.go.dev/crypto/tls?tab=doc#example-Config-VerifyPeerCertificate
402-
// for more info.
403-
func NewSkipHostnameVerificationConfig(rootCAs *x509.CertPool) *tls.Config {
404-
// Disable "G402 (CWE-295): TLS InsecureSkipVerify set true. (Confidence: HIGH, Severity: HIGH)"
405-
// #nosec G402
406-
return &tls.Config{
407-
// Set to true because otherwise the certs AND the hostname are verified.
408-
// Instead, the certificate verification will be done by the custom
409-
// VerifyPeerCertificate, ignoring the server name,
410-
InsecureSkipVerify: true,
411-
VerifyPeerCertificate: func(certificates [][]byte, _ [][]*x509.Certificate) error {
412-
certs := make([]*x509.Certificate, len(certificates))
413-
for i, asn1Data := range certificates {
414-
cert, err := x509.ParseCertificate(asn1Data)
415-
if err != nil {
416-
return fmt.Errorf("failed to parse certificate from server: %w", err)
417-
}
418-
certs[i] = cert
419-
}
420-
421-
// Leave DNSName empty to skip hostname verification.
422-
opts := x509.VerifyOptions{
423-
Roots: rootCAs,
424-
Intermediates: x509.NewCertPool(),
425-
}
426-
// Skip the first cert because it's the leaf. All others
427-
// are intermediates.
428-
for _, cert := range certs[1:] {
429-
opts.Intermediates.AddCert(cert)
430-
}
431-
432-
_, err := certs[0].Verify(opts)
433-
return err
434-
},
435-
}
436-
}

0 commit comments

Comments
 (0)