Skip to content

Commit

Permalink
fix: empty sni cause vmess parser to crash (Qv2ray#1448)
Browse files Browse the repository at this point in the history
* fix: empty sni cause vmess parser to crash

* chores: bumping build version
  • Loading branch information
DuckSoft authored May 1, 2021
1 parent 95245f9 commit e58e54b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion makespec/BUILDVERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6201
6203
5 changes: 3 additions & 2 deletions src/core/connection/serialization/vmess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ namespace Qv2ray::core::connection
__vmess_checker__func(tls, << "none" //
<< "tls"); //
//
__vmess_checker__func(sni, nothing); //
path = vmessConf.contains("path") ? vmessConf["path"].toVariant().toString() : (net == "quic" ? "" : "/");
host = vmessConf.contains("host") ? vmessConf["host"].toVariant().toString() : (net == "quic" ? "none" : "");
}
Expand Down Expand Up @@ -288,8 +287,10 @@ namespace Qv2ray::core::connection
}

streaming.security = tls;
if (tls == "tls" && !sni.isEmpty())
if (tls == "tls")
{
if (sni.isEmpty() && !host.isEmpty())
sni = host;
streaming.tlsSettings.serverName = sni;
streaming.tlsSettings.allowInsecure = false;
}
Expand Down

0 comments on commit e58e54b

Please sign in to comment.