summaryrefslogtreecommitdiff
path: root/methods/http.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2024-12-21 15:26:34 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2024-12-22 23:45:15 +0100
commit7b1fb90b93ced7c0772d726e512da01fad456852 (patch)
tree0c20cecf6451fa20e5ede1ba38f0ac1873860549 /methods/http.cc
parent90270f0959d490d56db891809d83c91b3d4b9bf0 (diff)
Remove GnuTLS and gcrypt support
OpenSSL is mandatory now, it is no longer possible to build without https support either.
Diffstat (limited to 'methods/http.cc')
-rw-r--r--methods/http.cc15
1 files changed, 0 insertions, 15 deletions
diff --git a/methods/http.cc b/methods/http.cc
index 48c3d540d..678ce3952 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -428,9 +428,7 @@ ResultState HttpServerState::Open()
Out.Reset();
Persistent = true;
-#if defined(HAVE_GNUTLS) || defined(WITH_OPENSSL)
bool tls = (ServerName.Access == "https" || APT::String::Endswith(ServerName.Access, "+https"));
-#endif
// Determine the proxy setting
// Used to run AutoDetectProxy(ServerName) here, but we now send a Proxy
@@ -455,7 +453,6 @@ ResultState HttpServerState::Open()
{
char *result = getenv("http_proxy");
Proxy = result ? result : "";
-#if defined(HAVE_GNUTLS) || defined(WITH_OPENSSL)
if (tls == true)
{
char *result = getenv("https_proxy");
@@ -464,7 +461,6 @@ ResultState HttpServerState::Open()
Proxy = result;
}
}
-#endif
}
}
@@ -478,13 +474,8 @@ ResultState HttpServerState::Open()
if (Proxy.empty() == false)
Owner->AddProxyAuth(Proxy, ServerName);
-#if defined(HAVE_GNUTLS) || defined(WITH_OPENSSL)
auto const DefaultService = tls ? "https" : "http";
auto const DefaultPort = tls ? 443 : 80;
-#else
- auto const DefaultService = "http";
- auto const DefaultPort = 80;
-#endif
if (Proxy.Access == "socks5h")
{
auto result = Connect(Proxy.Host, Proxy.Port, "socks", 1080, ServerFd, TimeOut, Owner);
@@ -518,15 +509,12 @@ ResultState HttpServerState::Open()
Port = Proxy.Port;
Host = Proxy.Host;
-#if defined(HAVE_GNUTLS) || defined(WITH_OPENSSL)
if (Proxy.Access == "https" && Port == 0)
Port = 443;
-#endif
}
auto result = Connect(Host, Port, DefaultService, DefaultPort, ServerFd, TimeOut, Owner);
if (result != ResultState::SUCCESSFUL)
return result;
-#if defined(HAVE_GNUTLS) || defined(WITH_OPENSSL)
if (Host == Proxy.Host && Proxy.Access == "https")
{
aptConfigWrapperForMethods ProxyConf{std::vector<std::string>{"http", "https"}};
@@ -541,13 +529,10 @@ ResultState HttpServerState::Open()
if (result != ResultState::SUCCESSFUL)
return result;
}
-#endif
}
-#if defined(HAVE_GNUTLS) || defined(WITH_OPENSSL)
if (tls)
return UnwrapTLS(ServerName.Host, ServerFd, TimeOut, Owner, Owner);
-#endif
return ResultState::SUCCESSFUL;
}