[Solved] Windows Libpack: Where is Qt getting OpenSSL from?

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
chennes
Veteran
Posts: 3868
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

[Solved] Windows Libpack: Where is Qt getting OpenSSL from?

Post by chennes »

I'm having a problem using QtNetwork stuff from Python on Windows: when I try to establish an SSL connection I am getting

Code: Select all

14:44:29  QSslSocket: cannot resolve EVP_PKEY_param_check
14:44:29  QSslSocket: cannot resolve SSL_CTX_set_ciphersuites
14:44:29  QSslSocket: cannot resolve SSL_set_psk_use_session_callback
14:44:29  QSslSocket: cannot resolve SSL_SESSION_is_resumable
14:44:29  QSslSocket: OpenSSL >= 1.1.1 is required; OpenSSL 1.1.0j  20 Nov 2018 was found instead
As far as I am aware, the the latest libpack (I'm using 12.5.3) ships with OpenSSL 3.0. So why does Qt think it's using OpenSSL 1.1.0j? That is indeed too old to be used with Qt 5.15, which is the Qt version the LibPack is shipping with. Any suggestions for debugging this?
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
wmayer
Founder
Posts: 20202
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Windows Libpack: Where is Qt getting OpenSSL from?

Post by wmayer »

This is how it worked in the past: https://forum.freecadweb.org/viewtopic. ... 50#p498650
As far as I am aware, the the latest libpack (I'm using 12.5.3) ships with OpenSSL 3.0. So why does Qt think it's using OpenSSL 1.1.0j? That is indeed too old to be used with Qt 5.15, which is the Qt version the LibPack is shipping with. Any suggestions for debugging this?
When checking the Qt code I can't find anything about OpenSSL 3.0 but 1.1
https://code.woboq.org/qt5/qtbase/src/n ... dedOpenSsl

The source code is from 5.14:
https://code.woboq.org/qt5/qtbase/src/c ... fig.h.html
User avatar
chennes
Veteran
Posts: 3868
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Windows Libpack: Where is Qt getting OpenSSL from?

Post by chennes »

This is even more strange to me now: I can run the example code from the post you link to just fine, I get no errors:

Code: Select all

from PySide2.QtNetwork import *
from PySide2.QtCore import *

mgr = QNetworkAccessManager()
reply = mgr.get(QNetworkRequest(QUrl("https://ipinfo.io/ip")));
reply.error()
content = reply.readAll()
content.data()
(EDIT: Actually, that's wrong, I don't know where they went the first time, but I do get the same SSL errors on the mgr.get call)

That is very similar to the code I'm trying to put into the AddonManager! All I've done is split it up to allow me to enqueue a whole bunch of requests and let the QNAM do async downloading.

Code: Select all

        download_queue = QtNetwork.QNetworkAccessManager()        
        for repo in self.repos:
            downloader = MetadataDownloadWorker(None, repo)
            downloader.start_fetch(download_queue)
Where MetadataDownloadWorker looks like:

Code: Select all

class MetadataDownloadWorker(QObject):
    def __init__(self, parent, repo):
        super().__init__(parent)
        self.repo = repo
        self.request = QtNetwork.QNetworkRequest(QtCore.QUrl(self.repo[1]))

    def start_fetch(self, network_manager):
        self.fetch_task = network_manager.get(self.request)
        self.fetch_task.finished.connect(self.resolve_fetch)
        self.fetch_task.errorOccurred.connect(self.fetch_failed)
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
chennes
Veteran
Posts: 3868
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Windows Libpack: Where is Qt getting OpenSSL from?

Post by chennes »

Figured it out: the libpack includes an older version of OpenSSL as well, and Qt is grabbing that one. Replacing libssl-1_1-x64.dll with an identically named, but actually more recent version (1.1.1l) makes it work.

@apeltauer, can you update the 1.x version of OpenSSL in the libpack to the latest release in the 1.x series? It's 1.1.1l right now.
apeltauer wrote: Ping
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
apeltauer
Posts: 399
Joined: Fri Aug 11, 2017 2:19 pm

Re: [Solved] Windows Libpack: Where is Qt getting OpenSSL from?

Post by apeltauer »

Will have a look at Monday….
User avatar
apeltauer
Posts: 399
Joined: Fri Aug 11, 2017 2:19 pm

Re: [Solved] Windows Libpack: Where is Qt getting OpenSSL from?

Post by apeltauer »

Post Reply