Skip to content

Commit cc10c5c

Browse files
committed
feat: delegate vendoring of OpenSSL to git2 dependency tree
libgit2 is the only reason we rely on OpenSSL instead of using rust-native TLS solutions.
1 parent f2f694f commit cc10c5c

File tree

3 files changed

+2
-14
lines changed

3 files changed

+2
-14
lines changed

Cargo.lock

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cpp-linter/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ futures = "0.3.31"
2323
git2 = "0.20.2"
2424
lenient_semver = "0.4.2"
2525
log = { version = "0.4.28", features = ["std"] }
26-
openssl = { version = "0.10", features = ["vendored"], optional = true }
27-
openssl-probe = { version = "0.1", optional = true }
2826
quick-xml = { version = "0.38.3", features = ["serialize"] }
2927
regex = "1.11.2"
3028
reqwest = "0.12.23"
@@ -39,9 +37,10 @@ which = "8.0.0"
3937
[dev-dependencies]
4038
mockito = "1.7.0"
4139
tempfile = "3.22.0"
40+
git2 = { version = "0.20.2", features = ["https"]}
4241

4342
[features]
44-
openssl-vendored = ["dep:openssl", "dep:openssl-probe"]
43+
openssl-vendored = ["git2/vendored-openssl"]
4544

4645
[lib]
4746
bench = false

cpp-linter/src/run.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@ use crate::rest_api::{github::GithubApiClient, RestApiClient};
2222

2323
const VERSION: &str = env!("CARGO_PKG_VERSION");
2424

25-
fn probe_ssl_certs() {
26-
#[cfg(feature = "openssl-vendored")]
27-
unsafe {
28-
openssl_probe::init_openssl_env_vars();
29-
}
30-
}
31-
3225
/// This is the backend entry point for console applications.
3326
///
3427
/// The idea here is that all functionality is implemented in Rust. However, passing
@@ -49,8 +42,6 @@ fn probe_ssl_certs() {
4942
/// alias ("path/to/cpp-linter.exe"). Thus, the parser in [`crate::cli`] will halt on an error
5043
/// because it is not configured to handle positional arguments.
5144
pub async fn run_main(args: Vec<String>) -> Result<()> {
52-
probe_ssl_certs();
53-
5445
let arg_parser = get_arg_parser();
5546
let args = arg_parser.get_matches_from(args);
5647
let cli = Cli::from(&args);

0 commit comments

Comments
 (0)