diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-09-30 00:50:14 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-09-30 00:50:14 +0900 |
| commit | 90515dfa50c676df37f440893de6e344fbfd2cdc (patch) | |
| tree | 257d86e0614b6eb0ea8e9384af3269d60a53dbbc /src/DownloadEngineFactory.cc | |
| parent | 4b94ede268ff2ff793b22a0730dcbda09d280618 (diff) | |
RPC over SSL/TLS transport
To enable RPC over SSL/TLS, specify server certificate and private key
using --rpc-certificate and --rpc-private-key options and enable
--rpc-secure option. After the encryption is enabled, use https and
wss scheme to access RPC server.
Diffstat (limited to 'src/DownloadEngineFactory.cc')
| -rw-r--r-- | src/DownloadEngineFactory.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/DownloadEngineFactory.cc b/src/DownloadEngineFactory.cc index 7cdb8e3e..0aba1494 100644 --- a/src/DownloadEngineFactory.cc +++ b/src/DownloadEngineFactory.cc @@ -74,6 +74,7 @@ #include "DlAbortEx.h" #include "FileAllocationEntry.h" #include "HttpListenCommand.h" +#include "LogFactory.h" namespace aria2 { @@ -170,11 +171,15 @@ DownloadEngineFactory::newDownloadEngine } if(op->getAsBool(PREF_ENABLE_RPC)) { bool ok = false; + bool secure = op->getAsBool(PREF_RPC_SECURE); + if(secure) { + A2_LOG_NOTICE("RPC transport will be encrypted."); + } static int families[] = { AF_INET, AF_INET6 }; size_t familiesLength = op->getAsBool(PREF_DISABLE_IPV6)?1:2; for(size_t i = 0; i < familiesLength; ++i) { HttpListenCommand* httpListenCommand = - new HttpListenCommand(e->newCUID(), e.get(), families[i]); + new HttpListenCommand(e->newCUID(), e.get(), families[i], secure); if(httpListenCommand->bindPort(op->getAsInt(PREF_RPC_LISTEN_PORT))){ e->addCommand(httpListenCommand); ok = true; |
