about summary refs log tree commit diff
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2023-07-06 17:34:49 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2023-07-06 17:34:49 +0530
commit29bd4a3af92d8155686909604f6736c8e4af9b1a (patch)
tree681d75e6a111a4f3ffa0d2088556d8d2dac145cd
parentd3f25940cbf5000f931949e54022a80d74c96b30 (diff)
aria2: build with GNUTLS instead of OpenSSL
aria2's OpenSSL integration breaks down when interacting with TLS v1.3
enabled websites which manifests in errors like these:

```
07/05 12:26:53 [NOTICE] Downloading 1 item(s)

07/05 12:26:54 [ERROR] CUID#7 - Download aborted. URI=https://catbox.moe
Exception: [AbstractCommand.cc:351] errorCode=1 URI=https://catbox.moe
  -> [SocketCore.cc:1018] errorCode=1 SSL/TLS handshake failure: protocol error
```

There are multiple instances[1] of users reporting this to the aria2 issue
tracker, and one of those issues[2] documents using GnuTLS in place of OpenSSL
as a workaround for the TLS v1.3 woes. I've verified that it indeed fixes
the problem, and hence making this change in Nixpkgs.

1: https://github.com/aria2/aria2/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+%22protocol+error%22
2: https://github.com/aria2/aria2/issues/1494
-rw-r--r--pkgs/tools/networking/aria2/default.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkgs/tools/networking/aria2/default.nix b/pkgs/tools/networking/aria2/default.nix
index 216d27eb4e124..6c972bb239714 100644
--- a/pkgs/tools/networking/aria2/default.nix
+++ b/pkgs/tools/networking/aria2/default.nix
@@ -1,5 +1,5 @@
 { lib, stdenv, fetchFromGitHub, pkg-config, autoreconfHook
-, openssl, c-ares, libxml2, sqlite, zlib, libssh2
+, gnutls, c-ares, libxml2, sqlite, zlib, libssh2
 , cppunit, sphinx
 , Security
 }:
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   strictDeps = true;
   nativeBuildInputs = [ pkg-config autoreconfHook sphinx ];
 
-  buildInputs = [ openssl c-ares libxml2 sqlite zlib libssh2 ] ++
+  buildInputs = [ gnutls c-ares libxml2 sqlite zlib libssh2 ] ++
     lib.optional stdenv.isDarwin Security;
 
   outputs = [ "bin" "dev" "out" "doc" "man" ];