#### Description
Check if code and import statements are formatted, with additional
rules.
* https://golangci-lint.run/usage/formatters/#gofumpt
* https://go-critic.com/overview.html#paramtypecombine
This is the application of golangci-lint fmt ./... , the Makefile has
been update to include this behavior
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
#### Description
There are a bunch of warnings in the lint output about tenv being
deprecated, and moving to usetesting. Reference:
https://golangci-lint.run/usage/linters/#tenv
#### Link to tracking issue
none
#### Testing
Ran `make golint` and `make all`
<!--Describe the documentation added.-->
---------
Co-authored-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Allow users to mention their preferred curve types for ECDHE handshake.
Add a new config option for this.
This will provide users with more control over specific settings during
the handshake process.
<!--Describe what testing was performed and which tests were added.-->
#### Testing
Added
<!--Describe the documentation added.-->
#### Documentation
Updated readme<!--Please delete paragraphs that you did not use before
submitting.-->
Note: Please let me know if I need to open an issue for this.
#### Description
[gofumpt](https://golangci-lint.run/usage/linters/#gofumpt) is a
stricter format than gofmt, while being backwards compatible.
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
#### Description
[whitespace](https://golangci-lint.run/usage/linters/#whitespace) is a
linter that checks for unnecessary newlines at the start and end of
functions.
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
#### Description
Testifylint doesn't support it yet.
This replaces `Contains(t, err.Error()` by `ErrorContains(t, err` and
`Equal(t, err.Error()` by `EqualError(t, err`
As they both check for nil error it becomes useless to check it yourself
without having defined a custom message
<!-- Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com> -->
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
**Description:**
Opening this PR to prompt discussion about `configtls` and
`context.Context`.
We could add `context.Context` to these public functions and go through
the long deprecation/rename process, but I want to make sure it is
valuable.
Arguments against this PR:
- There isn't anything within these functions that currently rely on a
`context.Context`.
- There isn't anything inside these functions interact with the network.
Arguments in favor of this PR:
- Interacts with filesystem.
- Go best practice to allow passing context.
**Link to tracking Issue:**
Related to
https://github.com/open-telemetry/opentelemetry-collector/issues/9811
---------
Co-authored-by: Andrzej Stencel <astencel@sumologic.com>
**Description:**
Updates `ServerConfig` and `ClientConfig` to use
`IncludeSystemCACertsPool` when doing `LoadTLSConfig`. Previously
`IncludeSystemCACertsPool` was only used for `ServerConfig`'s
`ClientCAs` via `newClientCAsReloader`.
**Link to tracking Issue:**
Closes
https://github.com/open-telemetry/opentelemetry-collector/issues/9789
**Testing:**
Added more tests
**Description:**
Add `include_system_ca_certs_pool` to configtls, allowing to load system
certs and additional custom certs.
**Link to tracking Issue:**
Fixes#7774
**Description:**
Simply renames a few structs in the `configtls` package for consistence.
`TLSClientSetting` to `ClientConfig`
`TLSServerSetting` to `ServerConfig`
`TLSSetting` to `Config`
**Link to tracking Issue:** Fixes#9474
**Description:**
Add `cipher_suites` to configtls:
Users can specify a list of cipher suites to pick from. If left blank, a
safe default list is used.
**Link to tracking Issue:**
Fixes#8105
**Testing:**
Unit tests
**Documentation:**
godoc and README
---------
Co-authored-by: Alex Boten <aboten@lightstep.com>
* [chore] use license shortform
To remain consistent w/ contrib repo, see https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/22052
Signed-off-by: Alex Boten <aboten@lightstep.com>
* make goporto
Signed-off-by: Alex Boten <aboten@lightstep.com>
---------
Signed-off-by: Alex Boten <aboten@lightstep.com>
Reload client CAs in server TLS settings when file has been modified
Link to tracking Issue: #6524
---------
Co-authored-by: Alex Boten <alex@boten.ca>
Co-authored-by: Ben B. <bongartz@klimlive.de>
* Fixing incorrect TLS min and TLS max Versions by default
* Added test cases for TLS min and TLS max versions
* Added entry to changelog
* Added Invalid TLS test cases
* TLS MinVersion and TLS MaxVersion defaults to be handled by crypto/tls
* Removed description that can go out of sync
* Allow users to set min and max TLS versions
Users want to be to choose the min and max versions they want to allow. Introduce two new settings to make the version range configurable.
* Make linter happy
* Change configtls to parse a tls.Config to allow re-using in http connections
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
* mTLS: Add support to configure client CA and enforce ClientAuth.
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
* Refactor SecureReceiverSettings to use TLSSetting
* Address test code coverage failure
* Update file to use new license format
* Address few small comments
* Refactor common client TLS configuration.
* Formatting and such
* Add insecure options for test bed exporters
* Fix logic in opencensus exporter
* Add insecure flag to test configs
* Rename object and simplify loading of gRPC Credentials