Skip to content

Commit

Permalink
test(gitea): fix broken test in CI (#281)
Browse files Browse the repository at this point in the history
The test was broken in CI, but may work locally (on MacOS for example).
In CI it fails with: `self-signed certificate`

It's because of different behavior in `rust-native-tls` depending on the
platform. This PR eliminates the issue via explicit usage of rustls.
Alternative would be to disable cert verification, but it means test
would be useless.

Closes #273
  • Loading branch information
DDtKey authored Jan 27, 2025
1 parent 455fd79 commit 1611c67
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/gitea/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,7 @@ mod tests {
let ca = gitea.image().tls_ca().unwrap();
let ca = Certificate::from_pem(ca.as_bytes()).unwrap();
let client = reqwest::ClientBuilder::new()
.use_rustls_tls()
.add_root_certificate(ca)
.build()
.unwrap();
Expand Down

0 comments on commit 1611c67

Please sign in to comment.