1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

SRT: Support encrypt, with utest (#3223)

* SRT: support encrypt, with utest

* SRT: refine set srt option error log
This commit is contained in:
john 2022-10-28 16:55:35 +08:00 committed by GitHub
parent 8dcbcd1656
commit 7d9dc69ae1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 172 additions and 13 deletions

View file

@ -2332,7 +2332,7 @@ srs_error_t SrsConfig::check_normal_config()
&& n != "peerlatency" && n != "tlpkdrop" && n != "connect_timeout"
&& n != "sendbuf" && n != "recvbuf" && n != "payloadsize"
&& n != "default_app" && n != "sei_filter" && n != "mix_correct"
&& n != "tlpktdrop" && n != "tsbpdmode") {
&& n != "tlpktdrop" && n != "tsbpdmode" && n != "passphrase" && n != "pbkeylen") {
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal srt_server.%s", n.c_str());
}
}
@ -7768,6 +7768,40 @@ int SrsConfig::get_srto_payloadsize()
return atoi(conf->arg0().c_str());
}
string SrsConfig::get_srto_passphrase()
{
SRS_OVERWRITE_BY_ENV_STRING("srs.srt_server.passphrase");
static string DEFAULT = "";
SrsConfDirective* conf = root->get("srt_server");
if (!conf) {
return DEFAULT;
}
conf = conf->get("passphrase");
if (!conf || conf->arg0().empty()) {
return DEFAULT;
}
return conf->arg0();
}
int SrsConfig::get_srto_pbkeylen()
{
SRS_OVERWRITE_BY_ENV_INT("srs.srt_server.pbkeylen");
static int DEFAULT = 0;
SrsConfDirective* conf = root->get("srt_server");
if (!conf) {
return DEFAULT;
}
conf = conf->get("pbkeylen");
if (!conf || conf->arg0().empty()) {
return DEFAULT;
}
return atoi(conf->arg0().c_str());
}
string SrsConfig::get_default_app_name()
{
SRS_OVERWRITE_BY_ENV_STRING("srs.srt_server.default_app");