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

sslsni default support in 1.10.7 breaks verify-ca option #1106

Open
mszlgr opened this issue Feb 3, 2023 · 3 comments
Open

sslsni default support in 1.10.7 breaks verify-ca option #1106

mszlgr opened this issue Feb 3, 2023 · 3 comments

Comments

@mszlgr
Copy link

mszlgr commented Feb 3, 2023

After updating from 1.10.6 to 1.10.7 I found that when using sslmode=verify-ca mode:

In version 1.10.6 sslVerifyCertificateAuthority function was using empty string in its place, ignoring verification of leaf certificate.

I would like to be able to use sslsni option and on same time use verify-ca option.

@cbandy
Copy link
Contributor

cbandy commented Feb 5, 2023

The verify-ca option has always set DNSName during verify, but I agree, we don't want name verification in this function.

@cbandy
Copy link
Contributor

cbandy commented Feb 5, 2023

The behavior of DNSName wasn't documented until Go 1.15, so I suspect it was required at some point.

It looks like another case for sslsni=1 might cover this at the end of TestSSLVerifyCA.

pq/ssl_test.go

Lines 158 to 159 in 922c00e

// Test sslmode=verify-ca
func TestSSLVerifyCA(t *testing.T) {

@johto
Copy link
Contributor

johto commented Feb 16, 2023

The verify-ca option has always set DNSName during verify, but I agree, we don't want name verification in this function.

I was just hit by this. Looks like verify-ca requires the CN to match now. What's the correct fix here? Not setting DNSName at all? Do you want me to open a PR? (Though I don't feel like I have enough context here to write a good commit message.)

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

3 participants