advancedtls: Apply defaults before version check (#8684)
Prior to this change, creating an Options like
tlsOpts := &advancedtls.Options{
IdentityOptions:
advancedtls.IdentityCertificateOptions{IdentityProvider: certProvider},
// Note: Only MinTLSVersion is set, not MaxTLSVersion
MinTLSVersion: tls.VersionTLS13,
}
Would result in error:
the minimum TLS version is larger than the maximum TLS version
The documentation for the Options struct states that the default for
MaxTLSVersion is TLS 1.3 but the default was being applied after
checking whether MinTLSVersion > MaxTLSVersion.
The defaults are now applied first, prior to any checks.
Fixes #8649
Thank you for your PR. Please read and follow
https://github.com/grpc/grpc-go/blob/master/CONTRIBUTING.md, especially
the
"Guidelines for Pull Requests" section, and then delete this text before
entering your PR description.