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

Certificate info is printed only if peer verification succeeded #163

Closed
Dunemaster opened this issue Mar 11, 2015 · 10 comments
Closed

Certificate info is printed only if peer verification succeeded #163

Dunemaster opened this issue Mar 11, 2015 · 10 comments
Labels

Comments

@Dunemaster
Copy link

CURLINFO_CERTINFO force printing certificate chain information to output/debug function.
But it only works if peer verification succeeds, because it is implemented in servercert function, which is called from ossl_connect_step3.
This limitaion makes CURLINFO_CERTINFO much less useful, because certificate info is often used for certificate issues debugging

@bagder bagder added the TLS label Mar 11, 2015
@bagder
Copy link
Member

bagder commented Mar 11, 2015

I will agree that it would be useful to allow this to get extracted even when the check fails. You feel like taking a shot at a patch for that?

@Dunemaster
Copy link
Author

Yes, I think I do. Any tips or guidance for this particular spot?

@bagder
Copy link
Member

bagder commented Mar 12, 2015

Not really, i can't recall the exact reason why it ended up in that place within the handshake but a first try would be to just change where the call is made to instead be done before the certificate check is made.

@Dunemaster
Copy link
Author

Ok, thanks, Should I also add a command line option (--showCertChain ) to the tool?

@bagder
Copy link
Member

bagder commented Mar 13, 2015

That'd be great!

@Dunemaster
Copy link
Author

Unfortunately, OpenSSL does not keep certificate chain info when verification fails (see ssl3_get_server_certificate in openssl). So implementing this feature is impossible without changes to openssl

@bagder
Copy link
Member

bagder commented Mar 13, 2015

Ok, but isn't it possible to extract it before it fails then?

@Dunemaster
Copy link
Author

No. Certificate chain is kept inside openssl and and never assigned to anything visible from outside.

@bagder
Copy link
Member

bagder commented Mar 15, 2015

If you set CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST to 0 (like with --insecure) then you can still get the certs dumped without verification.

So what if we for example just stored the failed verification status and didn't react on it until after the certinfo is extracted?

@bagder
Copy link
Member

bagder commented Mar 26, 2015

Dead

@bagder bagder closed this as completed Mar 26, 2015
@lock lock bot locked as resolved and limited conversation to collaborators May 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants