Skip to content

Commit 6d1db14

Browse files
committed
use rustls platform verifier
1 parent fb8b9ee commit 6d1db14

File tree

6 files changed

+23
-29
lines changed

6 files changed

+23
-29
lines changed

.github/workflows/build.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,23 +67,23 @@ jobs:
6767
# APPLE_CODESIGN_KEY: '${{ secrets.APPLE_CODESIGN_KEY }}'
6868
# APPLE_CODESIGN_PASSWORD: '${{ secrets.APPLE_CODESIGN_PASSWORD }}'
6969
# echo Key is $(echo $APPLE_CODESIGN_KEY | base64 -d | wc -c) bytes
70-
# rcodesign sign target/release/fan --code-signature-flags=runtime --p12-password=$APPLE_CODESIGN_PASSWORD --p12-file=<(echo $APPLE_CODESIGN_KEY | base64 -d) --entitlements-xml-file=cli/entitlements.plist
70+
# rcodesign sign target/release/basjoofan --code-signature-flags=runtime --p12-password=$APPLE_CODESIGN_PASSWORD --p12-file=<(echo $APPLE_CODESIGN_KEY | base64 -d) --entitlements-xml-file=cli/entitlements.plist
7171
- name: Compress Archive (darwin or linux)
7272
if: contains(matrix.target, 'darwin') || contains(matrix.target, 'linux')
73-
run: zip -rj target/${{ matrix.target }}/release/fan-${{ matrix.target }}.zip target/${{ matrix.target }}/release/fan
73+
run: zip -rj target/${{ matrix.target }}/release/basjoofan-${{ matrix.target }}.zip target/${{ matrix.target }}/release/basjoofan
7474
- name: Compress Archive (windows)
7575
if: contains(matrix.target, 'windows')
76-
run: Compress-Archive -CompressionLevel Optimal -Force -Path target/${{ matrix.target }}/release/fan.exe -DestinationPath target/${{ matrix.target }}/release/fan-${{ matrix.target }}.zip
76+
run: Compress-Archive -CompressionLevel Optimal -Force -Path target/${{ matrix.target }}/release/basjoofan.exe -DestinationPath target/${{ matrix.target }}/release/basjoofan-${{ matrix.target }}.zip
7777
- name: Upload Artifacts
7878
uses: actions/upload-artifact@v4
7979
with:
80-
name: fan-${{ matrix.target }}
81-
path: target/${{ matrix.target }}/release/fan${{ contains(matrix.target, 'windows') && '.exe' || '' }}
80+
name: basjoofan-${{ matrix.target }}
81+
path: target/${{ matrix.target }}/release/basjoofan${{ contains(matrix.target, 'windows') && '.exe' || '' }}
8282
- name: Release Version
8383
uses: softprops/action-gh-release@v2
8484
if: startsWith(github.ref, 'refs/tags/')
8585
env:
8686
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8787
with:
88-
files: target/${{ matrix.target }}/release/fan-${{ matrix.target }}.zip
88+
files: target/${{ matrix.target }}/release/basjoofan-${{ matrix.target }}.zip
8989
draft: true

.github/workflows/image.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
tags: ${{ github.repository }}:test
2828
- name: Test Image
2929
run: |
30-
docker run --rm ${{ github.repository }}:test fan eval 'println("🍀 Hello Basjoofan!");'
30+
docker run --rm ${{ github.repository }}:test basjoofan eval 'println("🍀 Hello Basjoofan!");'
3131
- name: Echo Tag
3232
run: |
3333
tag=${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || github.sha }}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ RUN cargo build --release
66
# runtime stage use alpine as base image
77
FROM alpine:3.20.2
88
# copy compiled file from build stage
9-
COPY --from=builder ./target/release/fan /usr/bin
9+
COPY --from=builder ./target/release/basjoofan /usr/bin

cmd/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.0.1"
44
description = "basjoofan command"
55
repository = "https://github.com/basjoofan/lib"
66
license = "MIT OR Apache-2.0"
7-
authors = ["Lamb <lamb@basjoo.fan>"]
7+
authors = ["Lamb <lamb@basjoofan.com>"]
88
keywords = ["continuous", "test", "http"]
99
edition = "2021"
1010

@@ -14,10 +14,10 @@ path = "src/main.rs"
1414

1515
[dependencies]
1616
lib = { path = "../lib" }
17-
clap = { version = "4.5.23", features = ["derive"] }
17+
clap = { version = "4.5.28", features = ["derive"] }
1818
ctrlc = { version = "3.4.5"}
1919

2020
[dev-dependencies]
21-
assert_cmd = "2.0"
22-
assert_fs = "1.0"
23-
predicates = "3.0"
21+
assert_cmd = "2.0.16"
22+
assert_fs = "1.1.2"
23+
predicates = "3.1.3"

lib/Cargo.toml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,17 @@ version = "0.0.1"
44
description = "basjoofan library"
55
repository = "https://github.com/basjoofan/lib"
66
license = "MIT OR Apache-2.0"
7-
authors = ["Lamb <lamb@basjoo.fan>"]
7+
authors = ["Lamb <lamb@basjoofan.com>"]
88
keywords = ["continuous", "test", "http"]
99
edition = "2021"
1010

11-
[features]
12-
default = ["http"]
13-
http = ["rustls", "webpki-roots", "form_urlencoded", "multipart"]
14-
1511
[dependencies]
16-
form_urlencoded = { version = "1.2.1", optional = true }
17-
multipart = { version = "0.18.0", optional = true, default-features = false, features = ["client"] }
18-
rustls = { version = "0.23.20", optional = true, default-features = false, features = ["tls12", "std", "ring"] }
19-
webpki-roots = { version = "0.26.7", optional = true }
20-
#uuid = { version = "1.8.0", features = ["v7"] }
21-
regex = "1.11.1"
12+
form_urlencoded = { version = "1.2.1" }
13+
multipart = { version = "0.18.0", default-features = false, features = ["client"] }
14+
rustls = { version = "0.23.22", default-features = false, features = ["tls12", "std", "ring"] }
15+
rustls-platform-verifier = { version = "0.5.0"}
16+
#uuid = { version = "1.13.1", default-features = false, features = ["v7"] }
17+
regex = { version = "1.11.1" }
2218

2319
[dev-dependencies]
24-
avro = { version = "0.16", package = "apache-avro" }
20+
avro = { version = "0.17.0", package = "apache-avro" }

lib/src/http/stream.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,8 @@ impl Stream {
125125
}
126126

127127
fn connect_tls(host: &str, port: u16, connect_tiomeout: Option<Duration>, read_tiomeout: Option<Duration>) -> Result<Self, Error> {
128-
let store = rustls::RootCertStore {
129-
roots: webpki_roots::TLS_SERVER_ROOTS.into(),
130-
};
131-
let config = Arc::new(rustls::ClientConfig::builder().with_root_certificates(store).with_no_client_auth());
128+
use rustls_platform_verifier::BuilderVerifierExt;
129+
let config = Arc::new(rustls::ClientConfig::builder().with_platform_verifier().with_no_client_auth());
132130
let name = host.to_owned().try_into().map_err(|_e| Error::InvalidUrlHost)?;
133131
let attach = Box::new(rustls::ClientConnection::new(config, name).map_err(|_e| Error::TlsHandshakeFailed)?);
134132
let (stream, resolve) = Self::connect_tcp(host, port, connect_tiomeout, read_tiomeout)?;

0 commit comments

Comments
 (0)