https.cc 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550
  1. //-*- mode: cpp; mode: fold -*-
  2. // Description /*{{{*/
  3. // $Id: http.cc,v 1.59 2004/05/08 19:42:35 mdz Exp $
  4. /* ######################################################################
  5. HTTPS Acquire Method - This is the HTTPS acquire method for APT.
  6. It uses libcurl
  7. ##################################################################### */
  8. /*}}}*/
  9. // Include Files /*{{{*/
  10. #include <config.h>
  11. #include <apt-pkg/fileutl.h>
  12. #include <apt-pkg/error.h>
  13. #include <apt-pkg/hashes.h>
  14. #include <apt-pkg/netrc.h>
  15. #include <apt-pkg/configuration.h>
  16. #include <apt-pkg/macros.h>
  17. #include <apt-pkg/strutl.h>
  18. #include <apt-pkg/proxy.h>
  19. #include <sys/stat.h>
  20. #include <sys/time.h>
  21. #include <unistd.h>
  22. #include <stdio.h>
  23. #include <iostream>
  24. #include <sstream>
  25. #include <ctype.h>
  26. #include <stdlib.h>
  27. #include "https.h"
  28. #include <apti18n.h>
  29. /*}}}*/
  30. using namespace std;
  31. struct APT_HIDDEN CURLUserPointer {
  32. HttpsMethod * const https;
  33. HttpsMethod::FetchResult * const Res;
  34. HttpsMethod::FetchItem const * const Itm;
  35. CURLUserPointer(HttpsMethod * const https, HttpsMethod::FetchResult * const Res,
  36. HttpsMethod::FetchItem const * const Itm) : https(https), Res(Res), Itm(Itm) {}
  37. };
  38. size_t
  39. HttpsMethod::parse_header(void *buffer, size_t size, size_t nmemb, void *userp)
  40. {
  41. size_t len = size * nmemb;
  42. CURLUserPointer *me = static_cast<CURLUserPointer *>(userp);
  43. std::string line((char*) buffer, len);
  44. for (--len; len > 0; --len)
  45. if (isspace_ascii(line[len]) == 0)
  46. {
  47. ++len;
  48. break;
  49. }
  50. line.erase(len);
  51. if (line.empty() == true)
  52. {
  53. if (me->https->Server->Result != 416 && me->https->Server->StartPos != 0)
  54. ;
  55. else if (me->https->Server->Result == 416)
  56. {
  57. bool partialHit = false;
  58. if (me->Itm->ExpectedHashes.usable() == true)
  59. {
  60. Hashes resultHashes(me->Itm->ExpectedHashes);
  61. FileFd file(me->Itm->DestFile, FileFd::ReadOnly);
  62. me->https->Server->TotalFileSize = file.FileSize();
  63. me->https->Server->Date = file.ModificationTime();
  64. resultHashes.AddFD(file);
  65. HashStringList const hashList = resultHashes.GetHashStringList();
  66. partialHit = (me->Itm->ExpectedHashes == hashList);
  67. }
  68. else if (me->https->Server->Result == 416 && me->https->Server->TotalFileSize == me->https->File->FileSize())
  69. partialHit = true;
  70. if (partialHit == true)
  71. {
  72. me->https->Server->Result = 200;
  73. me->https->Server->StartPos = me->https->Server->TotalFileSize;
  74. // the actual size is not important for https as curl will deal with it
  75. // by itself and e.g. doesn't bother us with transport-encoding…
  76. me->https->Server->JunkSize = std::numeric_limits<unsigned long long>::max();
  77. }
  78. else
  79. me->https->Server->StartPos = 0;
  80. }
  81. else
  82. me->https->Server->StartPos = 0;
  83. me->Res->LastModified = me->https->Server->Date;
  84. me->Res->Size = me->https->Server->TotalFileSize;
  85. me->Res->ResumePoint = me->https->Server->StartPos;
  86. // we expect valid data, so tell our caller we get the file now
  87. if (me->https->Server->Result >= 200 && me->https->Server->Result < 300)
  88. {
  89. if (me->https->Server->JunkSize == 0 && me->Res->Size != 0 && me->Res->Size > me->Res->ResumePoint)
  90. me->https->URIStart(*me->Res);
  91. if (me->https->Server->AddPartialFileToHashes(*(me->https->File)) == false)
  92. return 0;
  93. }
  94. }
  95. else if (me->https->Server->HeaderLine(line) == false)
  96. return 0;
  97. return size*nmemb;
  98. }
  99. size_t
  100. HttpsMethod::write_data(void *buffer, size_t size, size_t nmemb, void *userp)
  101. {
  102. HttpsMethod *me = static_cast<HttpsMethod *>(userp);
  103. size_t buffer_size = size * nmemb;
  104. // we don't need to count the junk here, just drop anything we get as
  105. // we don't always know how long it would be, e.g. in chunked encoding.
  106. if (me->Server->JunkSize != 0)
  107. return buffer_size;
  108. if(me->File->Write(buffer, buffer_size) != true)
  109. return 0;
  110. if(me->Queue->MaximumSize > 0)
  111. {
  112. unsigned long long const TotalWritten = me->File->Tell();
  113. if (TotalWritten > me->Queue->MaximumSize)
  114. {
  115. me->SetFailReason("MaximumSizeExceeded");
  116. _error->Error("Writing more data than expected (%llu > %llu)",
  117. TotalWritten, me->Queue->MaximumSize);
  118. return 0;
  119. }
  120. }
  121. if (me->Server->GetHashes()->Add((unsigned char const * const)buffer, buffer_size) == false)
  122. return 0;
  123. return buffer_size;
  124. }
  125. // HttpsServerState::HttpsServerState - Constructor /*{{{*/
  126. HttpsServerState::HttpsServerState(URI Srv,HttpsMethod * Owner) : ServerState(Srv, Owner), Hash(NULL)
  127. {
  128. TimeOut = _config->FindI("Acquire::https::Timeout",TimeOut);
  129. Reset();
  130. }
  131. /*}}}*/
  132. bool HttpsServerState::InitHashes(HashStringList const &ExpectedHashes) /*{{{*/
  133. {
  134. delete Hash;
  135. Hash = new Hashes(ExpectedHashes);
  136. return true;
  137. }
  138. /*}}}*/
  139. APT_PURE Hashes * HttpsServerState::GetHashes() /*{{{*/
  140. {
  141. return Hash;
  142. }
  143. /*}}}*/
  144. void HttpsMethod::SetupProxy() /*{{{*/
  145. {
  146. URI ServerName = Queue->Uri;
  147. // Determine the proxy setting
  148. AutoDetectProxy(ServerName);
  149. // Curl should never read proxy settings from the environment, as
  150. // we determine which proxy to use. Do this for consistency among
  151. // methods and prevent an environment variable overriding a
  152. // no-proxy ("DIRECT") setting in apt.conf.
  153. curl_easy_setopt(curl, CURLOPT_PROXY, "");
  154. // Determine the proxy setting - try https first, fallback to http and use env at last
  155. string UseProxy = _config->Find("Acquire::https::Proxy::" + ServerName.Host,
  156. _config->Find("Acquire::http::Proxy::" + ServerName.Host).c_str());
  157. if (UseProxy.empty() == true)
  158. UseProxy = _config->Find("Acquire::https::Proxy", _config->Find("Acquire::http::Proxy").c_str());
  159. // User want to use NO proxy, so nothing to setup
  160. if (UseProxy == "DIRECT")
  161. return;
  162. // Parse no_proxy, a comma (,) separated list of domains we don't want to use
  163. // a proxy for so we stop right here if it is in the list
  164. if (getenv("no_proxy") != 0 && CheckDomainList(ServerName.Host,getenv("no_proxy")) == true)
  165. return;
  166. if (UseProxy.empty() == true)
  167. {
  168. const char* result = getenv("https_proxy");
  169. // FIXME: Fall back to http_proxy is to remain compatible with
  170. // existing setups and behaviour of apt.conf. This should be
  171. // deprecated in the future (including apt.conf). Most other
  172. // programs do not fall back to http proxy settings and neither
  173. // should Apt.
  174. if (result == NULL)
  175. result = getenv("http_proxy");
  176. UseProxy = result == NULL ? "" : result;
  177. }
  178. // Determine what host and port to use based on the proxy settings
  179. if (UseProxy.empty() == false)
  180. {
  181. Proxy = UseProxy;
  182. if (Proxy.Access == "socks5h")
  183. curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5_HOSTNAME);
  184. else if (Proxy.Access == "socks5")
  185. curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
  186. else if (Proxy.Access == "socks4a")
  187. curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4A);
  188. else if (Proxy.Access == "socks")
  189. curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
  190. else
  191. curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
  192. if (Proxy.Port != 1)
  193. curl_easy_setopt(curl, CURLOPT_PROXYPORT, Proxy.Port);
  194. curl_easy_setopt(curl, CURLOPT_PROXY, Proxy.Host.c_str());
  195. if (Proxy.User.empty() == false || Proxy.Password.empty() == false)
  196. {
  197. curl_easy_setopt(curl, CURLOPT_PROXYUSERNAME, Proxy.User.c_str());
  198. curl_easy_setopt(curl, CURLOPT_PROXYPASSWORD, Proxy.Password.c_str());
  199. }
  200. }
  201. } /*}}}*/
  202. // HttpsMethod::Fetch - Fetch an item /*{{{*/
  203. // ---------------------------------------------------------------------
  204. /* This adds an item to the pipeline. We keep the pipeline at a fixed
  205. depth. */
  206. bool HttpsMethod::Fetch(FetchItem *Itm)
  207. {
  208. struct stat SBuf;
  209. struct curl_slist *headers=NULL;
  210. char curl_errorstr[CURL_ERROR_SIZE];
  211. URI Uri = Itm->Uri;
  212. string remotehost = Uri.Host;
  213. // TODO:
  214. // - http::Pipeline-Depth
  215. // - error checking/reporting
  216. // - more debug options? (CURLOPT_DEBUGFUNCTION?)
  217. curl_easy_reset(curl);
  218. SetupProxy();
  219. maybe_add_auth (Uri, _config->FindFile("Dir::Etc::netrc"));
  220. FetchResult Res;
  221. CURLUserPointer userp(this, &Res, Itm);
  222. // callbacks
  223. curl_easy_setopt(curl, CURLOPT_URL, static_cast<string>(Uri).c_str());
  224. curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, parse_header);
  225. curl_easy_setopt(curl, CURLOPT_WRITEHEADER, &userp);
  226. curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
  227. curl_easy_setopt(curl, CURLOPT_WRITEDATA, this);
  228. // options
  229. curl_easy_setopt(curl, CURLOPT_NOPROGRESS, true);
  230. curl_easy_setopt(curl, CURLOPT_FILETIME, true);
  231. // only allow curl to handle https, not the other stuff it supports
  232. curl_easy_setopt(curl, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS);
  233. curl_easy_setopt(curl, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTPS);
  234. // SSL parameters are set by default to the common (non mirror-specific) value
  235. // if available (or a default one) and gets overload by mirror-specific ones.
  236. // File containing the list of trusted CA.
  237. string cainfo = _config->Find("Acquire::https::CaInfo","");
  238. string knob = "Acquire::https::"+remotehost+"::CaInfo";
  239. cainfo = _config->Find(knob.c_str(),cainfo.c_str());
  240. if(cainfo.empty() == false)
  241. curl_easy_setopt(curl, CURLOPT_CAINFO,cainfo.c_str());
  242. // Check server certificate against previous CA list ...
  243. bool peer_verify = _config->FindB("Acquire::https::Verify-Peer",true);
  244. knob = "Acquire::https::" + remotehost + "::Verify-Peer";
  245. peer_verify = _config->FindB(knob.c_str(), peer_verify);
  246. curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, peer_verify);
  247. // ... and hostname against cert CN or subjectAltName
  248. bool verify = _config->FindB("Acquire::https::Verify-Host",true);
  249. knob = "Acquire::https::"+remotehost+"::Verify-Host";
  250. verify = _config->FindB(knob.c_str(),verify);
  251. int const default_verify = (verify == true) ? 2 : 0;
  252. curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, default_verify);
  253. // Also enforce issuer of server certificate using its cert
  254. string issuercert = _config->Find("Acquire::https::IssuerCert","");
  255. knob = "Acquire::https::"+remotehost+"::IssuerCert";
  256. issuercert = _config->Find(knob.c_str(),issuercert.c_str());
  257. if(issuercert.empty() == false)
  258. curl_easy_setopt(curl, CURLOPT_ISSUERCERT,issuercert.c_str());
  259. // For client authentication, certificate file ...
  260. string pem = _config->Find("Acquire::https::SslCert","");
  261. knob = "Acquire::https::"+remotehost+"::SslCert";
  262. pem = _config->Find(knob.c_str(),pem.c_str());
  263. if(pem.empty() == false)
  264. curl_easy_setopt(curl, CURLOPT_SSLCERT, pem.c_str());
  265. // ... and associated key.
  266. string key = _config->Find("Acquire::https::SslKey","");
  267. knob = "Acquire::https::"+remotehost+"::SslKey";
  268. key = _config->Find(knob.c_str(),key.c_str());
  269. if(key.empty() == false)
  270. curl_easy_setopt(curl, CURLOPT_SSLKEY, key.c_str());
  271. // Allow forcing SSL version to SSLv3 or TLSv1 (SSLv2 is not
  272. // supported by GnuTLS).
  273. long final_version = CURL_SSLVERSION_DEFAULT;
  274. string sslversion = _config->Find("Acquire::https::SslForceVersion","");
  275. knob = "Acquire::https::"+remotehost+"::SslForceVersion";
  276. sslversion = _config->Find(knob.c_str(),sslversion.c_str());
  277. if(sslversion == "TLSv1")
  278. final_version = CURL_SSLVERSION_TLSv1;
  279. else if(sslversion == "SSLv3")
  280. final_version = CURL_SSLVERSION_SSLv3;
  281. curl_easy_setopt(curl, CURLOPT_SSLVERSION, final_version);
  282. // CRL file
  283. string crlfile = _config->Find("Acquire::https::CrlFile","");
  284. knob = "Acquire::https::"+remotehost+"::CrlFile";
  285. crlfile = _config->Find(knob.c_str(),crlfile.c_str());
  286. if(crlfile.empty() == false)
  287. curl_easy_setopt(curl, CURLOPT_CRLFILE, crlfile.c_str());
  288. // cache-control
  289. if(_config->FindB("Acquire::https::No-Cache",
  290. _config->FindB("Acquire::http::No-Cache",false)) == false)
  291. {
  292. // cache enabled
  293. if (_config->FindB("Acquire::https::No-Store",
  294. _config->FindB("Acquire::http::No-Store",false)) == true)
  295. headers = curl_slist_append(headers,"Cache-Control: no-store");
  296. stringstream ss;
  297. ioprintf(ss, "Cache-Control: max-age=%u", _config->FindI("Acquire::https::Max-Age",
  298. _config->FindI("Acquire::http::Max-Age",0)));
  299. headers = curl_slist_append(headers, ss.str().c_str());
  300. } else {
  301. // cache disabled by user
  302. headers = curl_slist_append(headers, "Cache-Control: no-cache");
  303. headers = curl_slist_append(headers, "Pragma: no-cache");
  304. }
  305. curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
  306. // speed limit
  307. int const dlLimit = _config->FindI("Acquire::https::Dl-Limit",
  308. _config->FindI("Acquire::http::Dl-Limit",0))*1024;
  309. if (dlLimit > 0)
  310. curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, dlLimit);
  311. // set header
  312. curl_easy_setopt(curl, CURLOPT_USERAGENT,
  313. _config->Find("Acquire::https::User-Agent",
  314. _config->Find("Acquire::http::User-Agent",
  315. "Debian APT-CURL/1.0 (" PACKAGE_VERSION ")").c_str()).c_str());
  316. // set timeout
  317. int const timeout = _config->FindI("Acquire::https::Timeout",
  318. _config->FindI("Acquire::http::Timeout",120));
  319. curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, timeout);
  320. //set really low lowspeed timeout (see #497983)
  321. curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, DL_MIN_SPEED);
  322. curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, timeout);
  323. // set redirect options and default to 10 redirects
  324. curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, AllowRedirect);
  325. curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 10);
  326. // debug
  327. if (Debug == true)
  328. curl_easy_setopt(curl, CURLOPT_VERBOSE, true);
  329. // error handling
  330. curl_errorstr[0] = '\0';
  331. curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, curl_errorstr);
  332. // If we ask for uncompressed files servers might respond with content-
  333. // negotiation which lets us end up with compressed files we do not support,
  334. // see 657029, 657560 and co, so if we have no extension on the request
  335. // ask for text only. As a sidenote: If there is nothing to negotate servers
  336. // seem to be nice and ignore it.
  337. if (_config->FindB("Acquire::https::SendAccept", _config->FindB("Acquire::http::SendAccept", true)) == true)
  338. {
  339. size_t const filepos = Itm->Uri.find_last_of('/');
  340. string const file = Itm->Uri.substr(filepos + 1);
  341. if (flExtension(file) == file)
  342. headers = curl_slist_append(headers, "Accept: text/*");
  343. }
  344. // if we have the file send an if-range query with a range header
  345. if (stat(Itm->DestFile.c_str(),&SBuf) >= 0 && SBuf.st_size > 0)
  346. {
  347. std::string Buf;
  348. strprintf(Buf, "Range: bytes=%lli-", (long long) SBuf.st_size);
  349. headers = curl_slist_append(headers, Buf.c_str());
  350. strprintf(Buf, "If-Range: %s", TimeRFC1123(SBuf.st_mtime, false).c_str());
  351. headers = curl_slist_append(headers, Buf.c_str());
  352. }
  353. else if(Itm->LastModified > 0)
  354. {
  355. curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
  356. curl_easy_setopt(curl, CURLOPT_TIMEVALUE, Itm->LastModified);
  357. }
  358. // go for it - if the file exists, append on it
  359. File = new FileFd(Itm->DestFile, FileFd::WriteAny);
  360. Server = CreateServerState(Itm->Uri);
  361. if (Server->InitHashes(Itm->ExpectedHashes) == false)
  362. return false;
  363. // keep apt updated
  364. Res.Filename = Itm->DestFile;
  365. // get it!
  366. CURLcode success = curl_easy_perform(curl);
  367. // If the server returns 200 OK but the If-Modified-Since condition is not
  368. // met, CURLINFO_CONDITION_UNMET will be set to 1
  369. long curl_condition_unmet = 0;
  370. curl_easy_getinfo(curl, CURLINFO_CONDITION_UNMET, &curl_condition_unmet);
  371. File->Close();
  372. curl_slist_free_all(headers);
  373. // cleanup
  374. if (success != CURLE_OK)
  375. {
  376. #pragma GCC diagnostic push
  377. #pragma GCC diagnostic ignored "-Wswitch"
  378. switch (success)
  379. {
  380. case CURLE_COULDNT_RESOLVE_PROXY:
  381. case CURLE_COULDNT_RESOLVE_HOST:
  382. SetFailReason("ResolveFailure");
  383. break;
  384. case CURLE_COULDNT_CONNECT:
  385. SetFailReason("ConnectionRefused");
  386. break;
  387. case CURLE_OPERATION_TIMEDOUT:
  388. SetFailReason("Timeout");
  389. break;
  390. }
  391. #pragma GCC diagnostic pop
  392. // only take curls technical errors if we haven't our own
  393. // (e.g. for the maximum size limit we have and curls can be confusing)
  394. if (_error->PendingError() == false)
  395. _error->Error("%s", curl_errorstr);
  396. else
  397. _error->Warning("curl: %s", curl_errorstr);
  398. return false;
  399. }
  400. // server says file not modified
  401. if (Server->Result == 304 || curl_condition_unmet == 1)
  402. {
  403. RemoveFile("https", File->Name());
  404. Res.IMSHit = true;
  405. Res.LastModified = Itm->LastModified;
  406. Res.Size = 0;
  407. URIDone(Res);
  408. return true;
  409. }
  410. Res.IMSHit = false;
  411. if (Server->Result != 200 && // OK
  412. Server->Result != 206 && // Partial
  413. Server->Result != 416) // invalid Range
  414. {
  415. char err[255];
  416. snprintf(err, sizeof(err) - 1, "HttpError%i", Server->Result);
  417. SetFailReason(err);
  418. _error->Error("%i %s", Server->Result, Server->Code);
  419. // unlink, no need keep 401/404 page content in partial/
  420. RemoveFile("https", File->Name());
  421. return false;
  422. }
  423. // invalid range-request
  424. if (Server->Result == 416)
  425. {
  426. RemoveFile("https", File->Name());
  427. delete File;
  428. Redirect(Itm->Uri);
  429. return true;
  430. }
  431. struct stat resultStat;
  432. if (unlikely(stat(File->Name().c_str(), &resultStat) != 0))
  433. {
  434. _error->Errno("stat", "Unable to access file %s", File->Name().c_str());
  435. return false;
  436. }
  437. Res.Size = resultStat.st_size;
  438. // Timestamp
  439. curl_easy_getinfo(curl, CURLINFO_FILETIME, &Res.LastModified);
  440. if (Res.LastModified != -1)
  441. {
  442. struct timeval times[2];
  443. times[0].tv_sec = Res.LastModified;
  444. times[1].tv_sec = Res.LastModified;
  445. times[0].tv_usec = times[1].tv_usec = 0;
  446. utimes(File->Name().c_str(), times);
  447. }
  448. else
  449. Res.LastModified = resultStat.st_mtime;
  450. // take hashes
  451. Res.TakeHashes(*(Server->GetHashes()));
  452. // keep apt updated
  453. URIDone(Res);
  454. // cleanup
  455. delete File;
  456. return true;
  457. }
  458. /*}}}*/
  459. // HttpsMethod::Configuration - Handle a configuration message /*{{{*/
  460. bool HttpsMethod::Configuration(string Message)
  461. {
  462. if (ServerMethod::Configuration(Message) == false)
  463. return false;
  464. AllowRedirect = _config->FindB("Acquire::https::AllowRedirect",
  465. _config->FindB("Acquire::http::AllowRedirect", true));
  466. Debug = _config->FindB("Debug::Acquire::https",false);
  467. return true;
  468. }
  469. /*}}}*/
  470. std::unique_ptr<ServerState> HttpsMethod::CreateServerState(URI const &uri)/*{{{*/
  471. {
  472. return std::unique_ptr<ServerState>(new HttpsServerState(uri, this));
  473. }
  474. /*}}}*/
  475. int main()
  476. {
  477. return HttpsMethod().Run();
  478. }