Skip to content

Commit

Permalink
修改证书设定
Browse files Browse the repository at this point in the history
  • Loading branch information
luyu6056 committed Jan 20, 2025
1 parent eb6aae8 commit 5e9b761
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,13 @@
## 用法

修改rust-server/main.rs, let addr = "0.0.0.0:3304"; 改为server监听的端口
修改rust-client/main.rs, const ADDR: &str = "127.0.0.1:3304"; 改为上述server的公网 ip和端口
修改rust-client/main.rs, const ADDR: &str = "127.0.0.1:3304"; 改为上述server的公网 ip和端口

## 注意
为了使用自签证书,开启了以下设定
```rust
//rust-client/main.rs ,line 86
.use_sni(false)
.danger_accept_invalid_certs(true)
```
如果你使用可以通过ca校验的证书,可以尝试开启sni,把**danger_accept_invalid_certs**设置为**false**
1 change: 1 addition & 0 deletions rust-client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ async fn main() {
let connector: Arc<tokio_native_tls::TlsConnector> = Arc::new(
TlsConnector::builder()
.identity(identity)
.use_sni(false)
.danger_accept_invalid_certs(true)
.build()
.unwrap()
Expand Down

0 comments on commit 5e9b761

Please sign in to comment.