Add conditional for SSL_use_certificate_chain_file()

This commit is contained in:
cpq committed 2020-12-17 12:12:46 +00:00
1 parent 9f88f31f01
commit 4519ea568d
2 files changed
+4

No files matched your search

+2
View File
@@ -3202,10 +3202,12 @@ int mg_tls_init(struct mg_connection *c, struct mg_tls_opts *opts) {
} else if ((rc = SSL_use_PrivateKey_file(tls->ssl, key, 1)) != 1) {
mg_error(c, "Invalid SSL key, err %d", mg_tls_err(tls, rc));
goto fail;
#if OPENSSL_VERSION_NUMBER > 0x10002000L
} else if ((rc = SSL_use_certificate_chain_file(tls->ssl, opts->cert)) !=
1) {
mg_error(c, "Invalid CA, err %d", mg_tls_err(tls, rc));
goto fail;
#endif
} else {
SSL_set_mode(tls->ssl, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
#if OPENSSL_VERSION_NUMBER > 0x10002000L
+2
View File
@@ -235,10 +235,12 @@ int mg_tls_init(struct mg_connection *c, struct mg_tls_opts *opts) {
} else if ((rc = SSL_use_PrivateKey_file(tls->ssl, key, 1)) != 1) {
mg_error(c, "Invalid SSL key, err %d", mg_tls_err(tls, rc));
goto fail;
#if OPENSSL_VERSION_NUMBER > 0x10002000L
} else if ((rc = SSL_use_certificate_chain_file(tls->ssl, opts->cert)) !=
1) {
mg_error(c, "Invalid CA, err %d", mg_tls_err(tls, rc));
goto fail;
#endif
} else {
SSL_set_mode(tls->ssl, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
#if OPENSSL_VERSION_NUMBER > 0x10002000L