Skip to content

Commit

Permalink
Add 'tls' workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rustworthy committed Feb 4, 2024
1 parent 11ae26c commit de82109
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, macos-latest]
# run on stable and beta to ensure that tests won't break on the next version
# of the rust toolchain
toolchain: [stable, beta]
Expand Down
18 changes: 14 additions & 4 deletions tests/real/community.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,20 @@ fn roundtrip_tls() {
.unwrap();
let tls = || {
let cert = Certificate::from_pem(cert.as_bytes()).unwrap();
let connector = TlsConnector::builder()
.add_root_certificate(cert)
.build()
.unwrap();
let connector = if cfg!(target_os = "macos") {
TlsConnector::builder()
// Danger! Only for testing!
// On the macos CI runner, the certs are not trusted:
// { code: -67843, message: "The certificate was not trusted." }
.danger_accept_invalid_certs(true)
.build()
.unwrap()
} else {
TlsConnector::builder()
.add_root_certificate(cert)
.build()
.unwrap()
};
TlsStream::with_connector(
connector,
Some(
Expand Down

0 comments on commit de82109

Please sign in to comment.