-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add experimental support for rustls (#374)
* Add experimental support for rustls This adds experimental support for using rustls as a TLS backend for curl. This is made possible by the upstream rustls support recently merged into master. As such, this branch also updates the bundled curl version to the bleeding edge. We need to use a fork of the crustls wrapper layer for now in order to depend on it in an ideal way. I will work on upstreaming these changes before this can be merged. There's still some things that will need to be solved before we make this available for everyone, but I am already able to run a sample program with HTTPS successfully under rustls, which is very promising! * Formatting * Formatting * Add feature to readme * Use upstream version of crustls * Update to latest main * Update to bleeding edge * Add rustls test to CI * Bump to 0.8.2, disable bundled log capture * Use rustls-ffi version from Crates.io
- Loading branch information
Showing
7 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//! Simple HTTPS GET | ||
//! | ||
//! This example is a Rust adaptation of the [C example of the same | ||
//! name](https://curl.se/libcurl/c/https.html). | ||
extern crate curl; | ||
|
||
use curl::easy::Easy; | ||
use std::io::{stdout, Write}; | ||
|
||
fn main() -> Result<(), curl::Error> { | ||
let mut curl = Easy::new(); | ||
|
||
curl.url("https://example.com/")?; | ||
curl.write_function(|data| { | ||
stdout().write_all(data).unwrap(); | ||
Ok(data.len()) | ||
})?; | ||
|
||
curl.perform()?; | ||
|
||
Ok(()) | ||
} |