betta-cyber / netease-music-tui

netease cloud music terminal client by rust :zap:
MIT License
420 stars 34 forks source link

Fail to run when hosts are modified #7

Open CosmosAtlas opened 4 years ago

CosmosAtlas commented 4 years ago

ncmt fail to execute with the following error message.

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: reqwest::Error { kind: Request, url: "https://music.163.com/", source: hyper::Error(Connect, Ssl(Error { code: ErrorCode(1), cause: Some(Ssl(ErrorStack([Error { code: 337047686, library: "SSL routines", function: "tls_process_server_certificate", reason: "certificate verify failed", file: "ssl/statem/statem_clnt.c", line: 1913 }]))) }, X509VerifyResult { code: 62, error: "Hostname mismatch" })) }', src/libcore/result.rs:1165:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

Caused by host file being edited to redirect music.163.com Possible fix: don't change hosts (not application for people overseas)

Also, when trying to access ip limited songs when overseas ncmt will also crash.

betta-cyber commented 4 years ago

Ok, It seems that certificate verify failed when connect to music.163.com. maybe you should generate a cert and use it. https://github.com/Yufeikang/abroad_netease_muisc . I will test the condition for overseas and fix it.

And ip limited songs will get a message not a crash

CosmosAtlas commented 4 years ago

For me, I'm using those free DNS out there. So I have no control over the server.

Anyway, thanks for taking a look on this! I'll wait patiently until a new patch on this. :-)