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

Support x509 certification chiain in single pem file. v5.0.211 v6.0.122 (#4033)

Fix #3967 There is an API `SSL_use_certificate_chain_file`, which can load the
certification chain and also single certificate.

---------

Co-authored-by: winlin <winlinvip@gmail.com>
This commit is contained in:
Jacob Su 2024-04-22 10:15:11 +08:00 committed by GitHub
parent 427104f1da
commit 5eb802daca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 3 deletions

View file

@ -772,7 +772,7 @@ srs_error_t SrsSslConnection::handshake(string key_file, string crt_file)
int r0, r1, size;
// Setup the key and cert file for server.
if ((r0 = SSL_use_certificate_file(ssl, crt_file.c_str(), SSL_FILETYPE_PEM)) != 1) {
if ((r0 = SSL_use_certificate_chain_file(ssl, crt_file.c_str())) != 1) {
return srs_error_new(ERROR_HTTPS_KEY_CRT, "use cert %s", crt_file.c_str());
}