Describe the bug
|
// Do SSL handshake if HTTPS. |
|
if (ssl) { |
|
srs_utime_t starttime = srs_update_system_time(); |
|
string crt_file = _srs_config->get_https_stream_ssl_cert(); |
|
string key_file = _srs_config->get_https_stream_ssl_key(); |
|
if ((err = ssl->handshake(key_file, crt_file)) != srs_success) { |
SrsHttpxConn can be used as HTTP API and HTTP Server, for both plain and SSL connection. For the SSL connection, we can config the SSL key & cert in this way.
|
http_server { |
|
enabled on; |
|
listen 8080; |
|
dir ./objs/nginx/html; |
|
https { |
|
enabled on; |
|
listen 8088; |
|
key ./conf/server.key; |
|
cert ./conf/server.crt; |
|
} |
|
} |
|
|
|
http_api { |
|
enabled on; |
|
listen 1985; |
|
https { |
|
enabled on; |
|
listen 1990; |
|
key ./conf/server.key; |
|
cert ./conf/server.crt; |
|
} |
|
} |
And SrsConfig has apis to get the key & cert.
|
virtual std::string get_https_api_ssl_key(); |
|
virtual std::string get_https_api_ssl_cert(); |
|
virtual std::string get_https_stream_ssl_key(); |
|
virtual std::string get_https_stream_ssl_cert(); |
But SrsHttpxConn only calling get_https_stream_ssl_cert & get_https_stream_ssl_key even for the Https API connections.
Version
All SRS version.
To Reproduce
Steps to reproduce the behavior:
- config https api and https stream with different key & cert pair.
- boot the srs.
Expected behavior
http_api.https.key | cert should be loaded correctly.
Additional context
I found this bug when try to do #3701, found this bug and also #4024
Describe the bug
srs/trunk/src/app/srs_app_http_conn.cpp
Lines 382 to 387 in 427104f
SrsHttpxConncan be used as HTTP API and HTTP Server, for both plain and SSL connection. For the SSL connection, we can config the SSL key & cert in this way.srs/trunk/conf/https.srs.conf
Lines 7 to 28 in 427104f
And
SrsConfighas apis to get the key & cert.srs/trunk/src/app/srs_app_config.hpp
Lines 1052 to 1053 in 427104f
srs/trunk/src/app/srs_app_config.hpp
Lines 1074 to 1075 in 427104f
But
SrsHttpxConnonly callingget_https_stream_ssl_cert&get_https_stream_ssl_keyeven for theHttps APIconnections.Version
All SRS version.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
http_api.https.key | cert should be loaded correctly.
Additional context
I found this bug when try to do #3701, found this bug and also #4024