From b800af44090d4b70be7c5a94b15677327df84fcd Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 9 May 2023 13:19:48 +0200 Subject: [PATCH] ignore SA1019: ac.(*accessController).rootCerts.Subjects has been deprecated We need to look into this; can we remove it, or is there a replacement? Signed-off-by: Sebastiaan van Stijn (cherry picked from commit ebe9d67446a676d4b06f60a9c86e3ede66cc95fd) Signed-off-by: Sebastiaan van Stijn --- registry/auth/token/token_test.go | 2 +- registry/registry.go | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/registry/auth/token/token_test.go b/registry/auth/token/token_test.go index ec80d1bc8..49b836e0a 100644 --- a/registry/auth/token/token_test.go +++ b/registry/auth/token/token_test.go @@ -527,7 +527,7 @@ func TestNewAccessControllerPemBlock(t *testing.T) { t.Fatal(err) } - if len(ac.(*accessController).rootCerts.Subjects()) != 2 { + if len(ac.(*accessController).rootCerts.Subjects()) != 2 { //nolint:staticcheck // FIXME(thaJeztah): ignore SA1019: ac.(*accessController).rootCerts.Subjects has been deprecated since Go 1.18: if s was returned by SystemCertPool, Subjects will not include the system roots. (staticcheck) t.Fatal("accessController has the wrong number of certificates") } } diff --git a/registry/registry.go b/registry/registry.go index dc156f462..9486d8bba 100644 --- a/registry/registry.go +++ b/registry/registry.go @@ -236,11 +236,10 @@ func (registry *Registry) ListenAndServe() error { dcontext.GetLogger(registry.app).Infof("restricting TLS cipher suites to: %s", strings.Join(getCipherSuiteNames(tlsCipherSuites), ",")) tlsConf := &tls.Config{ - ClientAuth: tls.NoClientCert, - NextProtos: nextProtos(config), - MinVersion: tlsMinVersion, - PreferServerCipherSuites: true, - CipherSuites: tlsCipherSuites, + ClientAuth: tls.NoClientCert, + NextProtos: nextProtos(config), + MinVersion: tlsMinVersion, + CipherSuites: tlsCipherSuites, } if config.HTTP.TLS.LetsEncrypt.CacheFile != "" { @@ -282,7 +281,7 @@ func (registry *Registry) ListenAndServe() error { } } - for _, subj := range pool.Subjects() { + for _, subj := range pool.Subjects() { //nolint:staticcheck // FIXME(thaJeztah): ignore SA1019: ac.(*accessController).rootCerts.Subjects has been deprecated since Go 1.18: if s was returned by SystemCertPool, Subjects will not include the system roots. (staticcheck) dcontext.GetLogger(registry.app).Debugf("CA Subject: %s", string(subj)) }