summaryrefslogtreecommitdiff
path: root/src/MultiUrlRequestInfo.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-09-26 00:55:18 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-09-26 00:56:23 +0900
commit44479c910ecc89304fccea98b0ce0bed5d3e3801 (patch)
treeac609127e2ab4ea18f949ea4ef705ca33e02a41a /src/MultiUrlRequestInfo.cc
parent7f18494a8c1b714368e64e7abd7abb30c123a862 (diff)
Log exception; throw error if loading private key and/or certificate failed
Diffstat (limited to 'src/MultiUrlRequestInfo.cc')
-rw-r--r--src/MultiUrlRequestInfo.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/MultiUrlRequestInfo.cc b/src/MultiUrlRequestInfo.cc
index 6e5edd37..395ea692 100644
--- a/src/MultiUrlRequestInfo.cc
+++ b/src/MultiUrlRequestInfo.cc
@@ -188,8 +188,12 @@ int MultiUrlRequestInfo::prepare()
// We set server TLS context to the SocketCore before creating
// DownloadEngine instance.
std::shared_ptr<TLSContext> svTlsContext(TLSContext::make(TLS_SERVER));
- svTlsContext->addCredentialFile(option_->get(PREF_RPC_CERTIFICATE),
- option_->get(PREF_RPC_PRIVATE_KEY));
+ if(!svTlsContext->addCredentialFile
+ (option_->get(PREF_RPC_CERTIFICATE),
+ option_->get(PREF_RPC_PRIVATE_KEY))) {
+ throw DL_ABORT_EX("Loading private key and/or certificate for secure "
+ "RPC failed.");
+ }
SocketCore::setServerTLSContext(svTlsContext);
}
#endif // ENABLE_SSL
@@ -285,6 +289,7 @@ int MultiUrlRequestInfo::prepare()
}
e_->getRequestGroupMan()->getNetStat().downloadStart();
} catch(RecoverableException& e) {
+ A2_LOG_ERROR_EX(EX_EXCEPTION_CAUGHT, e);
SingletonHolder<Notifier>::clear();
if(useSignalHandler_) {
resetSignalHandlers();