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

Add option to allow connections with invalid ssl certificates #56

Merged
merged 2 commits into from
Mar 24, 2018
Merged

Add option to allow connections with invalid ssl certificates #56

merged 2 commits into from
Mar 24, 2018

Conversation

scottschroeder
Copy link
Contributor

DON'T MERGE, blocked on kornelski/rust-security-framework#46

Motivation

I know this is just... wrong, and everyone should be using letsencrypt, or adding their self-signed cert as a trusted root. Allowing invalid SSL connections is still a "feature" that rust doesn't have, and I'd like to fix that.

Also, this should put #13 to bed.

Changes

Interface

Added danger_disable_certificate_validation_entirely() to the TlsConnectorBuilder, along with a strongly worded doc-string about fire and brimstone. Please let me know if this needs to be more obnoxious.

OpenSSL

Set the provided SSL_VERIFY_NONE flag.

Schannel

Register a validation callback which will validate any certificate.

security-framework

Set a flag in the ClientBuilder to accept invalid certificates. This is blocked on updates to the security-framework crate.

Testing

Built a project using rust-native-tls, and made connections to:

Verified that each url goes from failure to success by setting danger_disable_certificate_validation_entirely(). This was done on a linux, mac, and windows workstation.

Cargo.toml Outdated
security-framework = { version = "0.1.15", features = ["OSX_10_8" ]}
security-framework-sys = "0.1.15"
security-framework = { git = "https://github.com/scottschroeder/rust-security-framework", branch = "noverify", features = ["OSX_10_8" ]}
security-framework-sys = { git = "https://github.com/scottschroeder/rust-security-framework", branch = "noverify" }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is blocked on updates to the security-framework crate, I'll update the Cargo.toml if/when a new crate gets published there.

@xaocon
Copy link

xaocon commented Oct 19, 2017

I noticed that kornelski/rust-security-framework#46 is merged. Can this be merged now or is there a wait for sfackler/rust-security-framework to cut a new release?

@scottschroeder
Copy link
Contributor Author

Yeah, waiting on a new crate to get published. Then I'll update this PR to reflect the new version.

@fulara
Copy link

fulara commented Mar 17, 2018

Will this ever go in ? :(
Currently I am building using scott' fork.

Thanks scott btw!

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

Successfully merging this pull request may close these issues.

None yet

4 participants