mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-21 19:51:50 +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) {
|
} 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));
|
mg_error(c, "Invalid SSL key, err %d", mg_tls_err(tls, rc));
|
||||||
goto fail;
|
goto fail;
|
||||||
|
#if OPENSSL_VERSION_NUMBER > 0x10002000L
|
||||||
} else if ((rc = SSL_use_certificate_chain_file(tls->ssl, opts->cert)) !=
|
} else if ((rc = SSL_use_certificate_chain_file(tls->ssl, opts->cert)) !=
|
||||||
1) {
|
1) {
|
||||||
mg_error(c, "Invalid CA, err %d", mg_tls_err(tls, rc));
|
mg_error(c, "Invalid CA, err %d", mg_tls_err(tls, rc));
|
||||||
goto fail;
|
goto fail;
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
SSL_set_mode(tls->ssl, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
|
SSL_set_mode(tls->ssl, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
|
||||||
#if OPENSSL_VERSION_NUMBER > 0x10002000L
|
#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) {
|
} 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));
|
mg_error(c, "Invalid SSL key, err %d", mg_tls_err(tls, rc));
|
||||||
goto fail;
|
goto fail;
|
||||||
|
#if OPENSSL_VERSION_NUMBER > 0x10002000L
|
||||||
} else if ((rc = SSL_use_certificate_chain_file(tls->ssl, opts->cert)) !=
|
} else if ((rc = SSL_use_certificate_chain_file(tls->ssl, opts->cert)) !=
|
||||||
1) {
|
1) {
|
||||||
mg_error(c, "Invalid CA, err %d", mg_tls_err(tls, rc));
|
mg_error(c, "Invalid CA, err %d", mg_tls_err(tls, rc));
|
||||||
goto fail;
|
goto fail;
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
SSL_set_mode(tls->ssl, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
|
SSL_set_mode(tls->ssl, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
|
||||||
#if OPENSSL_VERSION_NUMBER > 0x10002000L
|
#if OPENSSL_VERSION_NUMBER > 0x10002000L
|
||||||
|
|||||||
Reference in new issue
Block a user