Skip to content

Commit

Permalink
Bump version 0.2.23
Browse files Browse the repository at this point in the history
  • Loading branch information
ssrlive committed May 3, 2024
1 parent cb21e0d commit a738bce
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 17 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
- name: Prepare
shell: bash
run: |
cargo install cbindgen
mkdir release
rustup target add ${{ matrix.target }}
if [[ "${{ matrix.host_os }}" == "ubuntu-latest" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "overtls"
version = "0.2.22"
version = "0.2.23"
edition = "2021"
license = "MIT"
description = "A simple proxy tunnel, minimalist tool for bypassing the GFW."
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ impl Config {
(false, _) => server_host,
};
if client.server_host.is_empty() {
client.server_host = server_host.clone();
client.server_host.clone_from(&server_host);
}
if client.server_domain.is_none() || client.server_domain.as_ref().unwrap_or(&"".to_string()).is_empty() {
client.server_domain = Some(server_host.clone());
Expand Down
25 changes: 10 additions & 15 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,20 @@ pub async fn run_server(config: &Config, exiting_flag: crate::CancellationToken)
let p = server.listen_port;
let addr: SocketAddr = (h, p).to_socket_addrs()?.next().ok_or("Invalid server listen address")?;

let certs = server.certfile.as_ref().and_then(|cert| {
if !config.disable_tls() {
server_load_certs(cert).ok()
} else {
None
let certs = server.certfile.as_ref().filter(|_| !config.disable_tls()).and_then(|cert| {
let certs = server_load_certs(cert);
if let Err(err) = &certs {
log::warn!("failed to load certificate file: {}", err);
}
certs.ok()
});

let keys = server.keyfile.as_ref().and_then(|key| {
if !config.disable_tls() {
let keys = server_load_keys(key).ok();
if keys.as_ref().map(|keys| keys.len()).unwrap_or(0) > 0 {
keys
} else {
None
}
} else {
None
let keys = server.keyfile.as_ref().filter(|_| !config.disable_tls()).and_then(|key| {
let keys = server_load_keys(key);
if let Err(err) = &keys {
log::warn!("failed to load key file: {}", err);
}
keys.ok().filter(|keys| !keys.is_empty())
});

let svr_cfg = if let (Some(certs), Some(mut keys)) = (certs, keys) {
Expand Down

0 comments on commit a738bce

Please sign in to comment.