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

Is it possible to disable the cert verification? #13

Open
bbigras opened this issue Oct 23, 2016 · 9 comments
Open

Is it possible to disable the cert verification? #13

bbigras opened this issue Oct 23, 2016 · 9 comments

Comments

@bbigras
Copy link
Contributor

bbigras commented Oct 23, 2016

I would like to connect to services with self signed certificates.

@sfackler
Copy link
Collaborator

Are you able to insert that certificate into your system's trust store? That's the preferred method for dealing with self signed certificates.

@bbigras
Copy link
Contributor Author

bbigras commented Oct 24, 2016

I'm not sure. Is it possible to extract the cert on a random non-http tls connection?

I'm trying to communicate with an android app which generate a new self-signed cert on every device.

@bbigras
Copy link
Contributor Author

bbigras commented Oct 24, 2016

I think the app use cert verification after the two devices are paired with users confirmation and the cert is added to a cert pool.

@sfackler
Copy link
Collaborator

I think what should work here is to provide access to the schannel state after a failed handshake. That'll let you in particular have access to the peer's certificate. I'll be working on adding support to provide extra trust roots on a per-connection level soon, so you'll be able to reconnect with that certificate trusted.

@Arnavion
Copy link

This is also a problem with using Fiddler to intercept https connections. Currently InitializeSecurityContext fails with CRYPT_E_NO_REVOCATION_CHECK 0x80092012 The revocation function was unable to check revocation for the certificate. which is a valid error (Fiddler's trusted root doesn't have a valid revocation URL).

curl took the approach of providing a CLI flag to pass SCH_CRED_IGNORE_NO_REVOCATION_CHECK | SCH_CRED_IGNORE_REVOCATION_OFFLINE to AcquireCredentialsHandle

@sfackler
Copy link
Collaborator

That certainly seems reasonable - I'd be happy to take a PR with that option.

Do you know why Fiddler's root would have an invalid revocation URL rather than not having one at all?

@Arnavion
Copy link

It doesn't have one at all - I think that's what makes it invalid unless SCH_CRED_IGNORE_NO_REVOCATION_CHECK is passed in. It's probably because it's dynamically generated when you enable the "Decrypt HTTPS traffic".

That said, I'm not sure where the error is actually coming from. SchannelCred::acquire only sets SCH_USE_STRONG_CRYPTO and MSDN says SCH_CRED_IGNORE_NO_REVOCATION_CHECK would be ignored in this case.

I'll build a debug rustup and schannel and check.

@Arnavion
Copy link

Sorry, ignore me. The error is from rustup's curl backend. If I force it to use the hyper backend (that uses rust-native-tls and thus schannel-rs) there's no problems with Fiddler.

@sfackler
Copy link
Collaborator

Ah, great!

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