Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,23 @@ jobs:
RUST_BACKTRACE=1 cargo build --verbose --features ssl
RUST_BACKTRACE=1 cargo build --examples -j 8
- run:
name: Unit testing
name: Unit testing with ssl feature
command: |
RUST_BACKTRACE=1 cargo test -j 8 --verbose --features ssl
- run:
name: Unit testing with ssl-rustls feature
command: |
RUST_BACKTRACE=1 cargo test -j 8 --verbose --features ssl-rustls
- run:
name: More unit testing
command: |
docker load -i test-iostream
docker load -i test-signal
RUST_BACKTRACE=1 cargo test --verbose --features ssl -- --ignored
- run:
name: More unit testing with ssl-rustls
command: |
RUST_BACKTRACE=1 cargo test --verbose --features ssl-rustls -- --ignored
- save_cache:
key: cache-cargo-target-{{ .Environment.CIRCLE_JOB }}-{{ .Environment.CIRCLECI_CACHE_VERSION }}-{{ checksum "/tmp/build-dep" }}
paths:
Expand Down
155 changes: 155 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ experimental = []

# Enable OpenSSL both directly and for Hyper.
ssl = ["openssl", "native-tls", "hyper-tls"]
ssl-rustls = ["rustls", "hyper-rustls", "rustls-pemfile"]

[dependencies]
async-trait = "0.1"
Expand All @@ -34,7 +35,10 @@ futures = "0.3"
http = "0.2"
hyper = { version = "0.14", features = ["client", "http1", "stream", "tcp"] }
openssl = { version = "0.10", optional = true }
rustls = { version = "0.21", optional = true }
rustls-pemfile = { version = "1.0.0", optional = true }
hyper-tls = { version = "0.5", optional = true }
hyper-rustls = { version = "0.24", optional = true, features = ["http2"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
url = "2"
Expand Down
4 changes: 2 additions & 2 deletions src/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ impl Docker {
.into())
}

#[cfg(feature = "openssl")]
#[cfg(any(feature = "openssl", feature = "rustls"))]
pub fn connect_with_ssl(
addr: &str,
key: &Path,
Expand All @@ -298,7 +298,7 @@ impl Docker {
Ok(Docker::new(client, Protocol::Tcp))
}

#[cfg(not(feature = "openssl"))]
#[cfg(not(any(feature = "openssl", feature = "rustls")))]
pub fn connect_with_ssl(
_addr: &str,
_key: &Path,
Expand Down
3 changes: 3 additions & 0 deletions src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ pub enum Error {
#[cfg(feature = "openssl")]
#[error("ssl error")]
OpenSsl(#[from] openssl::error::ErrorStack),
#[cfg(feature = "rustls")]
#[error("ssl error")]
Rustls(#[from] rustls::Error),
#[error("could not connect: {}", addr)]
CouldNotConnect { addr: String, source: Box<Error> },
#[error("could not find DOCKER_CERT_PATH")]
Expand Down
Loading