Skip to content

Commit 4b55868

Browse files
committed
Fix tests with openssl 3
1 parent e91e9fb commit 4b55868

File tree

4 files changed

+26
-8
lines changed

4 files changed

+26
-8
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
env:
1212
RUSTFLAGS: -Dwarnings
1313
RUST_BACKTRACE: 1
14+
OPENSSL_CONF: test.conf
1415

1516
jobs:
1617
rustfmt:
@@ -35,7 +36,7 @@ jobs:
3536
- uses: actions/checkout@v2
3637
- uses: sfackler/actions/rustup@master
3738
with:
38-
version: 1.37.0
39+
version: 1.53.0
3940
- run: echo "::set-output name=version::$(rustc --version)"
4041
id: rust-version
4142
- uses: actions/cache@v1
@@ -54,5 +55,5 @@ jobs:
5455
with:
5556
path: target
5657
key: target-${{ runner.os }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }}
57-
- run: cargo test --features vendored
58-
- run: cargo test --features vendored,alpn
58+
- run: cargo test --features vendored,openssl-src/legacy
59+
- run: cargo test --features vendored,openssl-src/legacy,alpn

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ rustdoc-args = ["--cfg", "docsrs"]
1313

1414
[features]
1515
vendored = ["openssl/vendored"]
16-
alpn = ["security-framework/alpn"]
16+
alpn = ["security-framework/alpn"]
1717

1818
[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies]
1919
security-framework = "2.0.0"
@@ -31,6 +31,9 @@ openssl = "0.10.29"
3131
openssl-sys = "0.9.55"
3232
openssl-probe = "0.1"
3333

34+
[target.'cfg(not(any(target_os = "windows", target_os = "macos", target_os = "ios")))'.build_dependencies]
35+
openssl-src = { version = "300.0.3", optional = true }
36+
3437
[dev-dependencies]
3538
tempfile = "3.0"
3639
test-cert-gen = "0.1"

src/test.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ fn server_tls11_only() {
200200
&keys.server.pkcs12_password
201201
));
202202
let builder = p!(TlsAcceptor::builder(identity)
203-
.min_protocol_version(Some(Protocol::Tlsv11))
204-
.max_protocol_version(Some(Protocol::Tlsv11))
203+
.min_protocol_version(Some(Protocol::Tlsv12))
204+
.max_protocol_version(Some(Protocol::Tlsv12))
205205
.build());
206206

207207
let listener = p!(TcpListener::bind("0.0.0.0:0"));
@@ -223,8 +223,8 @@ fn server_tls11_only() {
223223
let socket = p!(TcpStream::connect(("localhost", port)));
224224
let builder = p!(TlsConnector::builder()
225225
.add_root_certificate(root_ca)
226-
.min_protocol_version(Some(Protocol::Tlsv11))
227-
.max_protocol_version(Some(Protocol::Tlsv11))
226+
.min_protocol_version(Some(Protocol::Tlsv12))
227+
.max_protocol_version(Some(Protocol::Tlsv12))
228228
.build());
229229
let mut socket = p!(builder.connect("localhost", socket));
230230

test.conf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
openssl_conf = openssl_init
2+
3+
[openssl_init]
4+
providers = providers
5+
6+
[providers]
7+
default = default_provider
8+
legacy = legacy_provider
9+
10+
[default_provider]
11+
activate = 1
12+
13+
[legacy_provider]
14+
activate = 1

0 commit comments

Comments
 (0)