Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Online library is empty in Windows build (missing TLS library) #780

Open
veloman-yunkan opened this issue Nov 26, 2024 · 8 comments
Open
Assignees
Labels

Comments

@veloman-yunkan
Copy link
Collaborator

Windows build of kiwix-desktop doesn't load the online library.

@kelson42
Copy link
Contributor

Wow, how is that possible!?

@veloman-yunkan
Copy link
Collaborator Author

veloman-yunkan commented Nov 26, 2024

So the problem was because of missing openssl libraries on which Qt depends - they are not by default present on Windows and are not bundled with Qt. So we have to distribute libssl-1_1-x64.dll and libcrypto-1_1-x64.dll with our kiwix-desktop package. The problem disappeared when I put those DLLs alongside kiwix-desktop.exe.

Note that there is no official source of OpenSSL binaries. For my experiments I got them from https://wiki.overbyte.eu/arch/openssl-1.1.1w-win32.zip (the download link is found on http://wiki.overbyte.eu/wiki/index.php/ICS_Download which is listed on https://wiki.openssl.org/index.php/Binaries) as well as built from source (using version/tag OpenSSL_1_1_1w).

@kelson42
Copy link
Contributor

Significant and urgent issue.

Moving to Kiwix-build.

@kelson42 kelson42 transferred this issue from kiwix/kiwix-desktop Nov 26, 2024
@kelson42 kelson42 changed the title Online library is empty in Windows build Online library is empty in Windows build (missing TLS library) Nov 26, 2024
@kelson42
Copy link
Contributor

@veloman-yunkan I propose:

  • We mirror these DLL binaries on https://dev.kiwix.org
  • We integrate them at build time in the ZIP
  • We open an issue as we should not work like this (we should recompile everything

Does that sounds good?

@kelson42 kelson42 pinned this issue Nov 27, 2024
@veloman-yunkan
Copy link
Collaborator Author

This seems to be only a problem with local builds when running kiwix-desktop from BUILD_native_static\INSTALL\bin directly on a machine where OpenSSL has not been installed (or is at least not in the PATH). Nightly builds of the kiwix-desktop package contain the required openssl DLLs. The packaging script takes care of that

# Copy ssl stuff
ssl_directory = Path("C:/") / "Program Files" / "OpenSSL"
shutil.copy2(ssl_directory / "libcrypto-1_1-x64.dll", out_dir)
shutil.copy2(ssl_directory / "libssl-1_1-x64.dll", out_dir)

However, it is not clear which step of the builder setup ensures that OpenSSL is installed. Is it a by-product of the Install and configure eSigner CKA and Windows SDK step?

- name: Install and configure eSigner CKA and Windows SDK
if: github.event_name == 'push'
env:
ESIGNER_URL: https://github.com/SSLcom/eSignerCKA/releases/download/v1.0.7/SSL.COM-eSigner-CKA_1.0.7.zip
run: |
Set-StrictMode -Version 'Latest'
# Download and Unzip eSignerCKA Setup
Invoke-WebRequest -OutFile eSigner_CKA_Setup.zip "$env:ESIGNER_URL"
Expand-Archive -Force eSigner_CKA_Setup.zip
Remove-Item eSigner_CKA_Setup.zip
Move-Item -Destination “eSigner_CKA_Installer.exe” -Path “eSigner_CKA_*\*.exe”
# Install eSignerCKA
New-Item -ItemType Directory -Force -Path "C:\esigner"
./eSigner_CKA_Installer.exe /CURRENTUSER /VERYSILENT /SUPPRESSMSGBOXES /DIR=”C:\esigner” /TYPE=automatic | Out-Null
Remove-Item "eSigner_CKA_Installer.exe"
# Configure the CKA with SSL.com credentials
C:\esigner\eSignerCKATool.exe config -mode product -user "${{ secrets.ESIGNER_USERNAME }}" -pass "${{ secrets.ESIGNER_PASSWORD }}" -totp "${{ secrets.ESIGNER_TOTP_SECRET }}" -key "C:\esigner\master.key" -r
C:\esigner\eSignerCKATool.exe unload
C:\esigner\eSignerCKATool.exe load
# Find certificate
$CodeSigningCert = Get-ChildItem Cert:\CurrentUser\My -CodeSigningCert | Select-Object -First 1
echo Certificate: $CodeSigningCert
# Extract thumbprint and subject name
$Thumbprint = $CodeSigningCert.Thumbprint
echo "SIGNTOOL_THUMBPRINT=$Thumbprint" >> $env:GITHUB_ENV

@veloman-yunkan
Copy link
Collaborator Author

However, it is not clear which step of the builder setup ensures that OpenSSL is installed.

Well, the good news is that OpenSSL is readily available on the GitHub windows-2022 runners:

https://github.com/actions/runner-images/blob/a03f6d0ec323000bcbc1bad92a15f9f069c07e93/images/windows/Windows2022-Readme.md

@veloman-yunkan
Copy link
Collaborator Author

BTW, it's worth noting that a plan existed to upgrade the version of OpenSLL on Windows runners to 3.x but was cancelled.

@kelson42
Copy link
Contributor

kelson42 commented Dec 3, 2024

@veloman-yunkan What would be the next step here? Should we just update the documetation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants