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

For #1657, Support HTTPS Streaming

This commit is contained in:
winlin 2020-11-06 17:22:23 +08:00
parent faf53927e8
commit 30ba5a32ed
10 changed files with 211 additions and 112 deletions

View file

@ -1703,7 +1703,10 @@ srs_error_t SrsHttpApi::on_start()
{
srs_error_t err = srs_success;
if (ssl && (err = ssl->handshake()) != srs_success) {
srs_utime_t starttime = srs_update_system_time();
string crt_file = _srs_config->get_https_api_ssl_cert();
string key_file = _srs_config->get_https_api_ssl_key();
if (ssl && (err = ssl->handshake(key_file, crt_file)) != srs_success) {
return srs_error_wrap(err, "handshake");
}
@ -1711,6 +1714,10 @@ srs_error_t SrsHttpApi::on_start()
return srs_error_wrap(err, "set jsonp");
}
int cost = srsu2msi(srs_update_system_time() - starttime);
srs_trace("https: api server done, use key %s and cert %s, cost=%dms",
key_file.c_str(), crt_file.c_str(), cost);
return err;
}