Tdesktop: Qt 5.6.2 will not build against OpenSSL 1.1.0, however no newer Qt patch provided

Created on 29 Dec 2017  路  6Comments  路  Source: telegramdesktop/tdesktop

Steps to reproduce

  1. Build Telegram-patched Qt 5.6.2 on openSUSE Tumbleweed

Expected behavior

Successful build.

Actual behaviour

The build fails to compile ssl/qsslcertificate_openssl.cpp:

ssl/qsslcertificate_openssl.cpp: In function 'uint qHash(const QSslCertificate&, uint)':
ssl/qsslcertificate_openssl.cpp:63:30: error: invalid use of incomplete type 'X509 {aka struct x509_st}'
return qHashBits(x509->sha1_hash, SHA_DIGEST_LENGTH, seed);
^~
In file included from /usr/include/openssl/crypto.h:31:0,
from /usr/include/openssl/comp.h:16,
from /usr/include/openssl/ssl.h:47,
from ../../include/QtNetwork/5.6.2/QtNetwork/private/../../../../../src/network/ssl/qsslcontext_openssl_p.h:53,
from ../../include/QtNetwork/5.6.2/QtNetwork/private/qsslcontext_openssl_p.h:1,
from ssl/qsslsocket_p.h:55,
from ssl/qsslsocket_openssl_p.h:63,
from ssl/qsslsocket_openssl_symbols_p.h:64,
from ssl/qsslcertificate_openssl.cpp:35:

Configuration

Operating system: openSUSE Tumbleweed (Or any Linux Distributed equipped with OpenSSL 1.1.0)

Version of Telegram Desktop: Newest (1.2.4)

Used theme: Doesn't really matter.

Note

I have been using Qt 5.6.2 to build Telegram from source code. But recently since my OS upgraded to OpenSSL 1.1.0, the build is broken because Qt 5.6.2 and the newest OpenSSL is incompatable.
Can we have a patch to a newer version of Qt Library that is compatible with the latest OpenSSL?

Logs:
Insert logs here (if necessary)
ssl/qsslcertificate_openssl.cpp:87:70: error: invalid use of incomplete type 'X509 {aka struct x509_st}'
QByteArray::number(qlonglong(q_ASN1_INTEGER_get(d->x509->cert_info->version)) + 1);
^~~
In file included from /usr/include/openssl/crypto.h:31:0,
from /usr/include/openssl/comp.h:16,
from /usr/include/openssl/ssl.h:47,
from ../../include/QtNetwork/5.6.2/QtNetwork/private/../../../../../src/network/ssl/qsslcontext_openssl_p.h:53,
from ../../include/QtNetwork/5.6.2/QtNetwork/private/qsslcontext_openssl_p.h:1,
from ssl/qsslsocket_p.h:55,
from ssl/qsslsocket_openssl_p.h:63,
from ssl/qsslsocket_openssl_symbols_p.h:64,
from ssl/qsslcertificate_openssl.cpp:35:
ssl/qsslcertificate_openssl.cpp:96:47: error: invalid use of incomplete type 'X509 {aka struct x509_st}'
ASN1_INTEGER *serialNumber = d->x509->cert_info->serialNumber;
^
~~
In file included from /usr/include/openssl/crypto.h:31:0,
from /usr/include/openssl/comp.h:16,
from /usr/include/openssl/ssl.h:47,
from ../../include/QtNetwork/5.6.2/QtNetwork/private/../../../../../src/network/ssl/qsslcontext_openssl_p.h:53,
from ../../include/QtNetwork/5.6.2/QtNetwork/private/qsslcontext_openssl_p.h:1,
from ssl/qsslsocket_p.h:55,
from ssl/qsslsocket_openssl_p.h:63,
from ssl/qsslsocket_openssl_symbols_p.h:64,
from ssl/qsslcertificate_openssl.cpp:35:

auto closed

Most helpful comment

@xuzhao9 Just use Debian or Fedora patches to build Telegram Desktop against system Qt. Don't use bundled static outdated Qt on modern distributions.

All 6 comments

Strange, this was merged few days ago:
https://github.com/telegramdesktop/tdesktop/pull/4061

@Aokromes This was fixing problems with Telegram Desktop code being incompatible with OpenSSL 1.1, while the issue is about Qt 5.6.2 code being incompatible with it.

So, no Telegram issue instead QT?

@Aokromes The issue is that Qt 5.6.2 does not compile with OpenSSL 1.1 AND tdesktop relies on static-linked patched Qt 5.6.2 library to build. I cannot use a newer version of Qt (such as 5.10) because telegram does not provide a patch in its source code repository.
Possible ways to fix:

  1. Tdesktop provides a patch for newer version of Qt (Qt 5.10 for example).
  2. Or, preferably you could consider merging the following patch in Arch AUR (https://aur.archlinux.org/cgit/aur.git/tree/tdesktop.patch?h=telegram-desktop-systemqt). This will let tdesktop dynamically link to the OS-provided Qt library and remove the dependency on patched, static-linked Qt.

@xuzhao9 Just use Debian or Fedora patches to build Telegram Desktop against system Qt. Don't use bundled static outdated Qt on modern distributions.

Hey there!

We're automatically closing this issue since there was no activity in this issue since 460 days ago. We therefore assume that the user has lost interest or resolved the problem on their own. Closed issues that remain inactive for a long period may get automatically locked.

Don't worry though; if this is in error, let us know with a comment and we'll be happy to reopen the issue.

Thanks!

(Please note that this is an automated comment.)

Was this page helpful?
0 / 5 - 0 ratings