Http sources not in use to speed up? #13206

Closed
opened 2026-02-21 23:40:44 -05:00 by deekerman · 19 comments
Owner

Originally created by @abcfy2 on GitHub (Mar 21, 2022).

qBittorrent & operating system versions

qBittorrent: 4.4.1 x64
Operating system: Manjaro KDE amd64
Qt: 6.2.3
libtorrent-rasterbar: 2.0.5

What is the problem?

Some torrents contain http sources, but seems not in use.

图片
图片

But other bittorrent clients like aria2 does not have this problem.

Steps to reproduce

Here is a sample torrent: https://download.manjaro.org/kde/21.2.5/manjaro-kde-21.2.5-minimal-220314-linux515.iso.torrent

Additional context

No response

Log(s) & preferences file(s)

No response

Originally created by @abcfy2 on GitHub (Mar 21, 2022). ### qBittorrent & operating system versions qBittorrent: 4.4.1 x64 Operating system: Manjaro KDE amd64 Qt: 6.2.3 libtorrent-rasterbar: 2.0.5 ### What is the problem? Some torrents contain http sources, but seems not in use. ![图片](https://user-images.githubusercontent.com/5327677/159285426-03171bfe-c010-4a83-9505-65ca6ebb0cd8.png) ![图片](https://user-images.githubusercontent.com/5327677/159285459-14b18352-4e61-4007-930e-4b4dac8bdb32.png) But other bittorrent clients like aria2 does not have this problem. ### Steps to reproduce Here is a sample torrent: https://download.manjaro.org/kde/21.2.5/manjaro-kde-21.2.5-minimal-220314-linux515.iso.torrent ### Additional context _No response_ ### Log(s) & preferences file(s) _No response_
Author
Owner

@thalieht commented on GitHub (Mar 21, 2022):

First peer i connected to with that torrent was of Connection type "Web". qBt doesn't differentiate between web_seed and http_seedhttps://www.libtorrent.org/reference-Core.html#peer_info dunno how to link directly, search for web_seed

github.com/qbittorrent/qBittorrent@baa8d2c326/src/base/bittorrent/peerinfo.cpp (L214-L222)

@thalieht commented on GitHub (Mar 21, 2022): First peer i connected to with that torrent was of Connection type "Web". qBt doesn't differentiate between `web_seed` and `http_seed`https://www.libtorrent.org/reference-Core.html#peer_info dunno how to link directly, search for `web_seed` https://github.com/qbittorrent/qBittorrent/blob/baa8d2c326241d9deafc8c4d6e515356fd1b3dd1/src/base/bittorrent/peerinfo.cpp#L214-L222
Author
Owner

@AbeniMatteo commented on GitHub (Mar 22, 2022):

Works fine for me.
image

@thalieht: there is no distinction between http_seed and web_seed but, in this case, "Web" is the correct connection type.
The peer is web_seed (connection type) sharing the file through HTTP.

@AbeniMatteo commented on GitHub (Mar 22, 2022): Works fine for me. ![image](https://user-images.githubusercontent.com/634710/159428148-f6e62b16-a06b-48a9-9f5b-e6ca8352873a.png) @thalieht: there is no distinction between `http_seed` and `web_seed` but, in this case, "Web" is the correct connection type. The peer is `web_seed` (connection type) sharing the file through `HTTP`.
Author
Owner

@abcfy2 commented on GitHub (Mar 22, 2022):

Why this is not working in my environment ?

I can't see the connection Web.

@abcfy2 commented on GitHub (Mar 22, 2022): Why this is not working in my environment ? I can't see the connection `Web`.
Author
Owner

@abcfy2 commented on GitHub (Mar 22, 2022):

Seems it's only a build issue ?

I try to install package in Archlinux sudo pacman -S qbittorrent, and it's working.

图片

But when I run from AppImage, it's not working.

图片

I don't know why.

@abcfy2 commented on GitHub (Mar 22, 2022): Seems it's only a build issue ? I try to install package in Archlinux `sudo pacman -S qbittorrent`, and it's working. ![图片](https://user-images.githubusercontent.com/5327677/159473409-55850614-073f-48c0-a38d-73fe87731875.png) But when I run from AppImage, it's not working. ![图片](https://user-images.githubusercontent.com/5327677/159473693-e3b03dfa-4378-4036-969e-1f220a719185.png) I don't know why.
Author
Owner

@AbeniMatteo commented on GitHub (Mar 22, 2022):

I'm starting up a VM with Manjaro, how did you install qBittorrent?

@AbeniMatteo commented on GitHub (Mar 22, 2022): I'm starting up a VM with Manjaro, how did you install qBittorrent?
Author
Owner

@abcfy2 commented on GitHub (Mar 22, 2022):

Install from pacman, it's working: sudo pacman -S qbittorrent, and run qbittorrent.

Running from AppImage (download from https://www.fosshub.com/qBittorrent.html), it's not working.

chmod +x qbittorrent-4.4.1_x86_64.AppImage
./qbittorrent-4.4.1_x86_64.AppImage

Thanks.

@abcfy2 commented on GitHub (Mar 22, 2022): Install from pacman, it's working: `sudo pacman -S qbittorrent`, and run `qbittorrent`. Running from AppImage (download from https://www.fosshub.com/qBittorrent.html), it's not working. ```sh chmod +x qbittorrent-4.4.1_x86_64.AppImage ./qbittorrent-4.4.1_x86_64.AppImage ``` Thanks.
Author
Owner

@abcfy2 commented on GitHub (Mar 22, 2022):

Maybe Appimage lost some optional dependencies when building ?

@abcfy2 commented on GitHub (Mar 22, 2022): Maybe Appimage lost some optional dependencies when building ?
Author
Owner

@AbeniMatteo commented on GitHub (Mar 22, 2022):

The problem presents itself with Manjaro+AppImage, Ubuntu 20.04LTS+AppImage works fine.

Repro:

@AbeniMatteo commented on GitHub (Mar 22, 2022): The problem presents itself with `Manjaro+AppImage`, `Ubuntu 20.04LTS+AppImage` works fine. Repro: - Install or live test `Manjaro 21.2.5` - Download AppImage from https://www.fosshub.com/qBittorrent.html?dwl=qbittorrent-4.4.1_x86_64.AppImage - Download torrent from https://download.manjaro.org/kde/21.2.5/manjaro-kde-21.2.5-minimal-220314-linux515.iso.torrent - `chmod +x qbittorrent-4.4.1_x86_64.AppImage` - `./qbittorrent-4.4.1_x86_64.AppImage` - Open and start the downloaded torrent
Author
Owner

@abcfy2 commented on GitHub (Mar 22, 2022):

Yeah, confirmed. Ubuntu + AppImage works very well.

And I found Fedora + AppImage has the same issue. So I think this might be build dependencies issue.

@abcfy2 commented on GitHub (Mar 22, 2022): Yeah, confirmed. Ubuntu + AppImage works very well. And I found Fedora + AppImage has the same issue. So I think this might be build dependencies issue.
Author
Owner

@abcfy2 commented on GitHub (Mar 22, 2022):

Oh, I found it. just uncheck validate HTTPS tracker certificates in Advanced config will solved this issue.

图片

@abcfy2 commented on GitHub (Mar 22, 2022): Oh, I found it. just uncheck `validate HTTPS tracker certificates` in Advanced config will solved this issue. ![图片](https://user-images.githubusercontent.com/5327677/159513342-a941f1cc-d1d7-4f72-aa76-e50918e61391.png)
Author
Owner

@AbeniMatteo commented on GitHub (Mar 22, 2022):

Yes, WireShark reports TLSv1.3 Record Layer: Alert (Level: Fatal, Description: Unknown CA).
Disabling the cert validation is a workaround, not the fix.

@AbeniMatteo commented on GitHub (Mar 22, 2022): Yes, WireShark reports `TLSv1.3 Record Layer: Alert (Level: Fatal, Description: Unknown CA)`. Disabling the cert validation is a workaround, not the fix.
Author
Owner

@abcfy2 commented on GitHub (Mar 22, 2022):

But I'm curious why Ubuntu is not affected. Both Manjaro and Fedora have this problem.

@abcfy2 commented on GitHub (Mar 22, 2022): But I'm curious why Ubuntu is not affected. Both Manjaro and Fedora have this problem.
Author
Owner

@AbeniMatteo commented on GitHub (Mar 22, 2022):

I'm onto something, can you run openssl version AND openssl version -d on Fedora and Arch and paste the results?

  • Ubuntu: 1.1.1f 31 Mar 2020 OPENSSLDIR: "/usr/lib/ssl"
  • Manjaro: 1.1.1m 14 Dec 2021 OPENSSLDIR: "/etc/ssl"
@AbeniMatteo commented on GitHub (Mar 22, 2022): I'm onto something, can you run `openssl version` AND `openssl version -d` on Fedora and Arch and paste the results? - Ubuntu: `1.1.1f 31 Mar 2020` `OPENSSLDIR: "/usr/lib/ssl"` - Manjaro: `1.1.1m 14 Dec 2021` `OPENSSLDIR: "/etc/ssl"`
Author
Owner

@abcfy2 commented on GitHub (Mar 22, 2022):

I have no ArchLinux. I just run this command in docker.

Arch:

openssl version: OpenSSL 1.1.1n 15 Mar 2022

openssl version -d: OPENSSLDIR: "/etc/ssl"

Fedora:

openssl version: OpenSSL 1.1.1l FIPS 24 Aug 2021

openssl version -d: OPENSSLDIR: "/etc/pki/tls"

@abcfy2 commented on GitHub (Mar 22, 2022): I have no ArchLinux. I just run this command in docker. Arch: openssl version: `OpenSSL 1.1.1n 15 Mar 2022` openssl version -d: `OPENSSLDIR: "/etc/ssl"` Fedora: openssl version: `OpenSSL 1.1.1l FIPS 24 Aug 2021` openssl version -d: `OPENSSLDIR: "/etc/pki/tls"`
Author
Owner

@AbeniMatteo commented on GitHub (Mar 22, 2022):

OpenSSL can't always find root CAs when mounted by AppImage so it can't download from httpS sources.
Running strace -o log.txt ./qbittorrent-4.4.1_x86_64.AppImage helps you see which file\directory it is scanning on each distro.

The problem is also tracked here.

@AbeniMatteo commented on GitHub (Mar 22, 2022): OpenSSL can't always find root CAs when mounted by AppImage so it can't download from httpS sources. Running `strace -o log.txt ./qbittorrent-4.4.1_x86_64.AppImage` helps you see which file\directory it is scanning on each distro. The problem is also tracked [here](https://github.com/openssl/openssl/issues/7481).
Author
Owner

@abcfy2 commented on GitHub (Mar 22, 2022):

Yes. Confirmed force set SSL_CERT_FILE=/etc/ssl/cert.pem will solve this issue:

SSL_CERT_FILE=/etc/ssl/cert.pem ./qbittorrent-4.4.1_x86_64.AppImage

But I think this could be done in AppImage.

@abcfy2 commented on GitHub (Mar 22, 2022): Yes. Confirmed force set `SSL_CERT_FILE=/etc/ssl/cert.pem` will solve this issue: ```sh SSL_CERT_FILE=/etc/ssl/cert.pem ./qbittorrent-4.4.1_x86_64.AppImage ``` But I think this could be done in AppImage.
Author
Owner

@abcfy2 commented on GitHub (Mar 22, 2022):

I create a PR to qbittorrent-enhanced-edition AppImage, maybe this can give some reference.

cat > AppRun <<EOF
#!/bin/bash -e

this_dir="\$(readlink -f "\$(dirname "\$0")")"
export XDG_DATA_DIRS="\${this_dir}/usr/share:\${XDG_DATA_DIRS}:/usr/share:/usr/local/share"
export QT_QPA_PLATFORMTHEMES=gtk2
export QT_STYLE_OVERRIDE=qt6gtk2

# Find the system certificates location
# https://gitlab.com/probono/platformissues/blob/master/README.md#certificates
possible_locations=(
  "/etc/ssl/certs/ca-certificates.crt"                # Debian/Ubuntu/Gentoo etc.
  "/etc/pki/tls/certs/ca-bundle.crt"                  # Fedora/RHEL
  "/etc/ssl/ca-bundle.pem"                            # OpenSUSE
  "/etc/pki/tls/cacert.pem"                           # OpenELEC
  "/etc/ssl/certs"                                    # SLES10/SLES11, https://golang.org/issue/12139
  "/usr/share/ca-certs/.prebuilt-store/"              # Clear Linux OS; https://github.com/knapsu/plex-media-player-appimage/issues/17#issuecomment-437710032
  "/system/etc/security/cacerts"                      # Android
  "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem" # CentOS/RHEL 7
  "/etc/ssl/cert.pem"                                 # Alpine Linux
)

for location in "\${possible_locations[@]}"; do
  if [ -r "\${location}" ]; then
    export SSL_CERT_FILE="\${location}"
    break
  fi
done

exec "\${this_dir}/usr/bin/qbittorrent" "\$@"
EOF
@abcfy2 commented on GitHub (Mar 22, 2022): I create a PR to qbittorrent-enhanced-edition AppImage, maybe this can give some reference. ```sh cat > AppRun <<EOF #!/bin/bash -e this_dir="\$(readlink -f "\$(dirname "\$0")")" export XDG_DATA_DIRS="\${this_dir}/usr/share:\${XDG_DATA_DIRS}:/usr/share:/usr/local/share" export QT_QPA_PLATFORMTHEMES=gtk2 export QT_STYLE_OVERRIDE=qt6gtk2 # Find the system certificates location # https://gitlab.com/probono/platformissues/blob/master/README.md#certificates possible_locations=( "/etc/ssl/certs/ca-certificates.crt" # Debian/Ubuntu/Gentoo etc. "/etc/pki/tls/certs/ca-bundle.crt" # Fedora/RHEL "/etc/ssl/ca-bundle.pem" # OpenSUSE "/etc/pki/tls/cacert.pem" # OpenELEC "/etc/ssl/certs" # SLES10/SLES11, https://golang.org/issue/12139 "/usr/share/ca-certs/.prebuilt-store/" # Clear Linux OS; https://github.com/knapsu/plex-media-player-appimage/issues/17#issuecomment-437710032 "/system/etc/security/cacerts" # Android "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem" # CentOS/RHEL 7 "/etc/ssl/cert.pem" # Alpine Linux ) for location in "\${possible_locations[@]}"; do if [ -r "\${location}" ]; then export SSL_CERT_FILE="\${location}" break fi done exec "\${this_dir}/usr/bin/qbittorrent" "\$@" EOF ```
Author
Owner

@ghost commented on GitHub (Mar 26, 2022):

@sledgehammer999 you might wanna take a look into this if you get time.

@ghost commented on GitHub (Mar 26, 2022): @sledgehammer999 you might wanna take a look into this if you get time.
Author
Owner

@luzpaz commented on GitHub (Aug 17, 2024):

@abcfy2 is this ticket still relevant ?

@luzpaz commented on GitHub (Aug 17, 2024): @abcfy2 is this ticket still relevant ?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/qBittorrent#13206
No description provided.