Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clients cannot verify server certificates when connecting #198

Open
wkral-netlync opened this issue Jul 5, 2024 · 0 comments
Open

Clients cannot verify server certificates when connecting #198

wkral-netlync opened this issue Jul 5, 2024 · 0 comments

Comments

@wkral-netlync
Copy link

Currently, there is no public interface to supply TLSConfig to the srv *Server argument of dialTLS. There is only one caller of dialTLS: DialTLSExt which constructs a Server without TLSConfig just prior to calling dialTLS.

So in dialTLS srv.TLSConfig is always nil in the following:

go-diameter/diam/client.go

Lines 135 to 139 in f6f1377

if srv.TLSConfig == nil {
config = &tls.Config{InsecureSkipVerify: true}
} else {
config = TLSConfigClone(srv.TLSConfig)
}

Therefore InsecureSkipVerify will always be true in the TLSConfig used by the client. It's an understandable default since ServerName must be part of the config if InsecureSkipVerify is false, according to: https://pkg.go.dev/crypto/tls#Client. Just there isn't a way to get to the other branch of that if. All the customization from supplying a TLSConfig such as using a different cert bundle than the system level certs are also not accessible.

Perhaps another DialTLS variant could be added to supply the TLSConfig? I expect the existing interfaces probably shouldn't change as there are likely many uses of them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant