mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-14 10:20:01 +00:00
Add conditional for SSL_use_certificate_chain_file()
This commit is contained in:
1 parent
9f88f31f01
commit
4519ea568d
2 files changed
+4
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user