mirror of https://github.com/aria2/aria2
parent
4c84af31be
commit
3b9a385305
|
@ -333,13 +333,13 @@ AppleTLSSession::AppleTLSSession(AppleTLSContext* ctx)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
SecIdentityRef creds = ctx->getCredentials();
|
||||||
|
if (!creds) {
|
||||||
if (ctx->getSide() != TLS_SERVER) {
|
if (ctx->getSide() != TLS_SERVER) {
|
||||||
// Done with client-only initialization
|
// Done with client-only initialization
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SecIdentityRef creds = ctx->getCredentials();
|
|
||||||
if (!creds) {
|
|
||||||
A2_LOG_ERROR("AppleTLS: No credentials");
|
A2_LOG_ERROR("AppleTLS: No credentials");
|
||||||
state_ = st_error;
|
state_ = st_error;
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -245,8 +245,7 @@ int MultiUrlRequestInfo::prepare()
|
||||||
|
|
||||||
#ifdef ENABLE_SSL
|
#ifdef ENABLE_SSL
|
||||||
std::shared_ptr<TLSContext> clTlsContext(TLSContext::make(TLS_CLIENT));
|
std::shared_ptr<TLSContext> clTlsContext(TLSContext::make(TLS_CLIENT));
|
||||||
if(!option_->blank(PREF_CERTIFICATE) &&
|
if(!option_->blank(PREF_CERTIFICATE)) {
|
||||||
!option_->blank(PREF_PRIVATE_KEY)) {
|
|
||||||
clTlsContext->addCredentialFile(option_->get(PREF_CERTIFICATE),
|
clTlsContext->addCredentialFile(option_->get(PREF_CERTIFICATE),
|
||||||
option_->get(PREF_PRIVATE_KEY));
|
option_->get(PREF_PRIVATE_KEY));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1155,11 +1155,20 @@ std::vector<OptionHandler*> OptionHandlerFactory::createOptionHandlers()
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
OptionHandler* op(new DefaultOptionHandler
|
OptionHandler* op(
|
||||||
|
#ifdef HAVE_APPLETLS
|
||||||
|
new DefaultOptionHandler
|
||||||
|
(PREF_CERTIFICATE,
|
||||||
|
TEXT_CERTIFICATE,
|
||||||
|
NO_DEFAULT_VALUE)
|
||||||
|
#else // HAVE_APPLETLS
|
||||||
|
new LocalFilePathOptionHandler
|
||||||
(PREF_CERTIFICATE,
|
(PREF_CERTIFICATE,
|
||||||
TEXT_CERTIFICATE,
|
TEXT_CERTIFICATE,
|
||||||
NO_DEFAULT_VALUE,
|
NO_DEFAULT_VALUE,
|
||||||
PATH_TO_FILE));
|
false)
|
||||||
|
#endif // HAVE_APPLETLS
|
||||||
|
);
|
||||||
op->addTag(TAG_HTTP);
|
op->addTag(TAG_HTTP);
|
||||||
op->addTag(TAG_HTTPS);
|
op->addTag(TAG_HTTPS);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
|
|
Loading…
Reference in New Issue