From 35fb09d1f30f7baa2d441aa71a372cfb9a4b9499 Mon Sep 17 00:00:00 2001 From: naoNao89 <90588855+naoNao89@users.noreply.github.com> Date: Thu, 18 Dec 2025 21:19:13 +0700 Subject: [PATCH] Add test for issue #632 HTTPS cert verification --- tests/easy.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/easy.rs b/tests/easy.rs index 625735936..6465fabc3 100644 --- a/tests/easy.rs +++ b/tests/easy.rs @@ -1008,6 +1008,32 @@ fn test_connect_timeout() { ); } +// Test for issue #632: HTTPS certificate verification on FreeBSD +// https://github.com/alexcrichton/curl-rust/issues/632 +// +// This test verifies HTTPS requests work with certificate verification. +// On FreeBSD 13.5/14.3 with curl-sys 0.4.84 (no fix), this would fail with: +// [60] SSL peer certificate or SSH remote key was not OK +#[test] +fn issue_632_https_cert_verification() { + let mut h = handle(); + + // The exact URL that fails on affected FreeBSD versions + t!(h.url("https://index.crates.io/config.json")); + + let mut data = Vec::new(); + t!(h.write_function(move |buf| { + data.extend_from_slice(buf); + Ok(buf.len()) + })); + + // This perform() call would fail on FreeBSD 13.5/14.3 without the fix + t!(h.perform()); + + // Verify successful response + assert_eq!(t!(h.response_code()), 200); +} + #[test] fn test_timeout() { use curl::easy::Handler;