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

Panic in master when printing certificates in 'certigo connect ...' #213

Closed
siebenmann opened this issue Feb 27, 2020 · 2 comments
Closed

Comments

@siebenmann
Copy link

Starting in commit f81df5c, certigo connect panics while printing certificate information:

$ certigo connect www.google.com:https
** TLS Connection **
Version: TLS 1.3
Cipher Suite: AES_128_GCM_SHA256 cipher

** CERTIFICATE 1 **
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/square/certigo/cli.Run(0xc0000200a0, 0x2, 0x2, 0x9cd2c0, 0xc0000101f0, 0x0)
        /homes/hawkwind/u0/cks/go/src/github.com/square/certigo/cli/cli.go:166 +0x207c
main.main()
        /homes/hawkwind/u0/cks/go/src/github.com/square/certigo/main.go:27 +0xae

This appears to happen because the the 'get certs by connecting to server' case in cli/cli.go's Run() function was updated to print the format of every certificate when this wasn't set. I don't know if the format information is meaningful here, but it's certainly not set, so we get a panic. Commenting out the line that prints to format makes things work again.

@mbyczkowski
Copy link
Contributor

I will look into this, thanks for the report!

@mcpherrinm
Copy link
Contributor

Fixed in #216, after bug was introduced in #210
And we have test coverage over that now

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