Skip to content

Commit

Permalink
Fix https certificates issue in AppImage and static linked. (#352)
Browse files Browse the repository at this point in the history
* update github action version

* Fix https certificates issue
  • Loading branch information
abcfy2 authored Mar 23, 2022
1 parent 1cb2614 commit 40456fc
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
container: "ubuntu:16.04"
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/cache@v2
uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
/usr/src/
Expand All @@ -28,7 +28,7 @@ jobs:
appimage-build-dependencies-cache-
- name: Build AppImage
run: .github/workflows/build_appimage.sh
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: qBittorrent-Enhanced-Edition-x86_64.AppImage
path: ".github/workflows/qBittorrent-Enhanced-Edition*.AppImage*"
Expand Down Expand Up @@ -63,8 +63,8 @@ jobs:
- x86_64-linux-musl
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/cache@v2
uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
/usr/src/
Expand All @@ -76,7 +76,7 @@ jobs:
env:
CROSS_HOST: "${{ matrix.cross_host }}"
run: .github/workflows/cross_build.sh
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: qbittorrent-enhanced-nox_${{ matrix.cross_host }}_static
path: |
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/build_appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,27 @@ export XDG_DATA_DIRS="\${this_dir}/usr/share:\${XDG_DATA_DIRS}:/usr/share:/usr/l
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
chmod 755 -v /tmp/qbee/AppDir/AppRun
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cross_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ prepare_ssl() {
touch "/usr/src/openssl-${openssl_ver}/.unpack_ok"
fi
cd "/usr/src/openssl-${openssl_ver}/"
./Configure -static --cross-compile-prefix="${CROSS_HOST}-" --prefix="${CROSS_PREFIX}" "${OPENSSL_COMPILER}"
./Configure -static --openssldir=/etc/ssl --cross-compile-prefix="${CROSS_HOST}-" --prefix="${CROSS_PREFIX}" "${OPENSSL_COMPILER}"
make -j$(nproc)
make install_sw
if [ -f "${CROSS_PREFIX}/lib64/libssl.a" ]; then
Expand Down

0 comments on commit 40456fc

Please sign in to comment.