diff options
author | HÃ¥vard Pettersen <havardpe@oath.com> | 2019-05-16 15:46:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-16 15:46:46 +0200 |
commit | f973a6caf1020f5ce2914b69852d5ab3cf40c3f8 (patch) | |
tree | 29ba5beef41a037f6b2ccd42dcc567ed48a80a14 | |
parent | df51f56396d4beb5bf36e766b61841af0642ab3a (diff) | |
parent | 40751f68804097d8988eeb246b21225c9f943129 (diff) |
Merge pull request #9441 from vespa-engine/havardpe/quick-exit-on-crypto-setup-failure
exit without core when crypto setup fails
-rw-r--r-- | vespalib/src/vespa/vespalib/net/crypto_engine.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/vespalib/src/vespa/vespalib/net/crypto_engine.cpp b/vespalib/src/vespa/vespalib/net/crypto_engine.cpp index a8808741806..e6127204ac2 100644 --- a/vespalib/src/vespa/vespalib/net/crypto_engine.cpp +++ b/vespalib/src/vespa/vespalib/net/crypto_engine.cpp @@ -1,15 +1,16 @@ // Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "crypto_engine.h" -#include <vespa/vespalib/stllike/string.h> +#include <vespa/vespalib/data/smart_buffer.h> #include <vespa/vespalib/net/tls/authorization_mode.h> #include <vespa/vespalib/net/tls/auto_reloading_tls_crypto_engine.h> +#include <vespa/vespalib/net/tls/crypto_exception.h> +#include <vespa/vespalib/net/tls/maybe_tls_crypto_engine.h> #include <vespa/vespalib/net/tls/statistics.h> +#include <vespa/vespalib/net/tls/tls_crypto_engine.h> #include <vespa/vespalib/net/tls/transport_security_options.h> #include <vespa/vespalib/net/tls/transport_security_options_reading.h> -#include <vespa/vespalib/net/tls/tls_crypto_engine.h> -#include <vespa/vespalib/net/tls/maybe_tls_crypto_engine.h> -#include <vespa/vespalib/data/smart_buffer.h> +#include <vespa/vespalib/stllike/string.h> #include <vector> #include <chrono> #include <thread> @@ -240,7 +241,12 @@ CryptoEngine::get_default() { std::lock_guard guard(_shared_lock); if (!_shared_default) { - _shared_default = create_default_crypto_engine(); + try { + _shared_default = create_default_crypto_engine(); + } catch (net::tls::CryptoException &e) { + LOG(error, "failed to create default crypto engine: %s", e.what()); + std::quick_exit(78); + } } return _shared_default; } |