Ошибка создания контекста ssl

I tried everything mentioned in this Question

but nothing worked.
The binary works fine on Windows 64-bit, but almost always shows the error

Error Creating SSL Context()

on Windows 32-bit. I tried the demo http client example.

Community's user avatar

asked Sep 19, 2013 at 12:00

adnan kamili's user avatar

adnan kamiliadnan kamili

8,8777 gold badges64 silver badges125 bronze badges

At last, I found the solution. I was downloading dll’s from a dll website. You need to take these libraries

- libeay32.dll
- libssl32.dll
- ssleay32.dll

from this website here Win32 OpenSSL v1.0.2 file for 32 bit if you are using MSVC++ compiler

After installation of the above binary, copy the above three dll’s in the the directory containing your binary file.

answered Sep 20, 2013 at 12:49

adnan kamili's user avatar

adnan kamiliadnan kamili

8,8777 gold badges64 silver badges125 bronze badges

4

This error happens if:

  • The libeay32.dll file and/or ssleay32.dll file is missing (and you need to place them beside your App’s executable).
  • Or, if libeay32.dll and/or ssleay32.dll are not compatible with your App.

I recommend this source for OpenSSL Windows binaries. These binaries have no external dependencies and tested with 32-bit and 64-bit Qt5.

Update: OpenSSL 1.0 and 1.1 are not binary- and API-compatible. As of Qt 5.12 (certainly 5.12.4) version 1.1 seems the default OpenSSL backend in Qt, although I hear it can be configured to keep using 1.0.
I’m testing this source for Windows OpenSSL 1.1 builds, no problems so far: https://bintray.com/vszakats/generic/openssl

Top-Master's user avatar

Top-Master

7,4535 gold badges39 silver badges68 bronze badges

answered Jan 4, 2016 at 7:14

Violet Giraffe's user avatar

Violet GiraffeViolet Giraffe

32.7k48 gold badges191 silver badges335 bronze badges

3

Comments

@gofmanalex

Hi all,

I use INDY components with Delphi and some stations sometimes get error when attempts creating SSL context

Indy error code 5
EIdOSSLCreatingContextError
Error creating SSL context

The error is occurring in IdSSLOpenSSL InitContext.
fContext := SSL_CTX_new(SSLMethod);
fContext is nil.

I use SSL23 method. TLS method doesn’t work
I use 1.0.2r versions of dlls

Thank for any advice?

@mattcaswell

Have you checked the OPENSSL error queue for any useful error messages, e.g. by using the ERR_print_errors_fp function.

@gofmanalex

error:140A90F1:lib(20):func(169):reason(241)
error:140A90F1:SSL routines: SSL_CTX_new: unable to load ssl2 md5 routines

Sometimes get EIdOSSLCreatingContextError without error code

@mattcaswell

The most likely explanation for this error is if you have attempted to build the library using the «no-md5» build time option. That option just doesn’t work («won’t fix» bug) in 1.0.2 and was removed from later versions as a result.

So, on the failing machines, how did you build the version of OpenSSL there?

@gofmanalex

I use dlls from openssl-1.0.2r-i386-win32
ssleay32.dll ver 1.0.2.18
libeay32.dll ver 1.0.2.18

@mattcaswell

I use dlls from openssl-1.0.2r-i386-win32
ssleay32.dll ver 1.0.2.18
libeay32.dll ver 1.0.2.18

Those version numbers don’t look like something the OpenSSL Project creates. Did you build the dlls from source yourself, or did you download the binaries from somewhere else? (If so — where?)

@mattcaswell

Another theory I have for what could cause this: If you fail to call SSL_library_init() then I think this could happen.

@gofmanalex

My project is written in Delphi. I just use TIdHTTP component of INDY.
The component use the dll. I don’t build or load dll manually.
The dll taken from https://indy.fulgan.com/SSL

@mattcaswell

Has SSL_library_init() always been called before the first call to SSL_CTX_new()?

@gofmanalex

Hi,
The saga continues. Solution still not found.
I upgraded the INDY components what i use up to 10.5520 version and openSSL libraries to 1.0.2t version, but a problem still throw (sometimes).

Now i got error code: 336236785
Error type: EIdOSSLCreatingContextError
Error creating SSL context
error:140A90F1:lib(20):func(169):reason(241)

I just use INDY TIdHTTP component with TIdSSLIOHandlerSocketOpenSSL and TIdMultiPartFormDataStream ad i don’t know about

Has SSL_library_init() always been called before the first call to SSL_CTX_new()?

I’m not initialize, not load and not free the dlls. The INDY component does all this work. (must do).

Interestingly, my other client has no such any problems.

@gofmanalex

Has SSL_library_init() always been called before the first call to SSL_CTX_new()?

I checked code of INDY. Yes. SSL_library_init() always called.

@gofmanalex

Server I want to connect to requires working with SSLv3 only

But When I trying to use sslvSSLv3 I gеt error:
ErrorCode: 5
ErrorClassName: EIdOSSLConnectError
ErrorMessage: Error connecting with SSL.
EOF was observed that violates the protocol

When I tried to use sslvSSLv23, I often get an error:
Error code: 336236785
Error type: EIdOSSLCreatingContextError
Error creating SSL context
error:140A90F1:lib(20):func(169):reason(241)

@mattcaswell

But When I trying to use sslvSSLv3 I gеt error:
ErrorCode: 5
ErrorClassName: EIdOSSLConnectError
ErrorMessage: Error connecting with SSL.
EOF was observed that violates the protocol

Can you get a packet trace using wireshark of the failing communication?

When I tried to use sslvSSLv23, I often get an error:
Error code: 336236785
Error type: EIdOSSLCreatingContextError
Error creating SSL context
error:140A90F1:lib(20):func(169):reason(241)

Often? Or Always? This error is the «unable to load ssl2 md5 routines» that is discussed above. If this works sometimes and doesn’t work others then it rules out the possibility that the library has been built with the «no-md5» option (since it that case the code to initialise the ssl2-md5 digest is not even compiled in, so there is no possibility that it would ever work)…

…actually thinking about it more if you avoid this error based on the method you are using then that rules that out anyway. If «no-md5» was the problem then this should always fail with the same error no matter what.

So, my best guess is that there is a problem with the SSL_library_init(() call. Perhaps a race condition which means it is sometimes called and sometimes not???

@byxueya

Is there a solution? I have the same problem

Хммм, угадываешь, что разделы «ожидал увидеть» и «что ты видел вместо этого» поменялись местами, или вы сообщаете, что предыдущая проблема исчезла? :улыбка:

Я вижу сообщение об ошибке, указанное в разделе «Ожидайте», при каждом запуске программы. Если я хорошо помню, 32-битная версия без проблем.

Интересно. С вашим сетевым подключением это WiFi или кабельное соединение?

Мы и раньше видели странное поведение с подключениями по Wi-Fi, но мы устранили «большинство» (!) Проблем. Большинство из них «мы думали, что разобрались, но оказалось не на 100%».

Если это не соединение Wi-Fi, это будет что-то другое. : frowning:

Его телеграфировали. Возможно, мне лучше установить 32-битную версию? Ошибки не было.

Да, обязательно попробуй. :улыбка:

Есть ли радость от 32-битной версии?

У 64-битных версий у меня проблемы. Браузеру БД для SQLCipher.exe требуется msvcr120.dll, а не запускается. Браузер БД для SQLite.exe открывается с сообщением об ошибке подключения.

32-битные версии работают отлично.

У меня такая же проблема с WiFi в 64-битной версии.

Изменить: а также 32-разрядную версию.

  • Я могу открыть (https://download.sqlitebrowser.org/currentrelease) в браузере.
  • Не за прокси.

Ах да. Текущая версия еще не поддерживает использование через прокси. Некоторое время назад мы добавили начальную поддержку прокси в ночные сборки, хотите ли вы ее протестировать? :улыбка:

https://nightlies.sqlitebrowser.org/latest/

О … разве вы не имеете в виду, что вы вообще не за прокси?

Ой, извините, я имел в виду, что я вообще не за прокси.

Однако у меня есть домашний шлюз от провайдера и к нему подключен дополнительный маршрутизатор. Я использую свой роутер для WiFi, не знаю, имеет ли это значение.

Без проблем. Вероятно, лучший ход, хотя и не фантастический, — просто отключить нашу автоматическую проверку обновлений при запуске. Это должно, по крайней мере, остановить появление сообщения об ошибке.

В какой-то момент нам, вероятно, потребуется написать простую утилиту специально для проверки, почему это происходит, или, возможно, добавить в приложение довольно обширное ведение журнала.

Однако это, вероятно, потребует больших усилий, поэтому вряд ли это произойдет в ближайшем будущем. : frowning:

Да, это не большая проблема, я просто хотел вам знать.
Не стесняйтесь сообщить мне, если я могу чем-либо помочь с тестированием.

Браузер БД потрясающий, он также очень помогает новичкам вроде меня, спасибо, ребята!

@Eschato — Эта проблема существует некоторое время, и мы сначала думали, что решили ее. Однако эта проблема возникает у очень небольшого числа пользователей. Интересно, что у вас такая же ошибка в 32-битной версии — вы уникальны!

В качестве еще одной «проверки», возникает ли у вас проблема с DB4S для SQLite с SQLCipher? (это отдельный .exe)

@chrisjlocke

Я не могу запустить SQLCipher, он говорит, что MSVCR120.dll отсутствует. Пробовал как 32, так и 64 бит. То же сообщение об ошибке для обоих.

Я не могу запустить SQLCipher, он говорит, что MSVCR120.dll отсутствует. Пробовал как 32, так и 64 бит. То же сообщение об ошибке для обоих.

Этого не должно быть. Отсутствующая DLL означает, что у вас не установлен распространяемый пакет Visual C ++ 2013. Это не требуется для установки / запуска браузера БД для SQLite. См. № 1912 и № 1884.

Можете ли вы дать ссылку на используемую вами версию?

Интересно. Есть ли вероятность, что старая версия DB4S все еще может быть частично установлена ​​где-то?

например, была установлена ​​новая версия, но существующая не была удалена.

Это могло объяснить странную ошибку MSVCR120.dll .

Ни одна из этих версий не зависит от Visual C ++ 2013, поэтому я не знаю, почему он запрашивает MSVCR120.dll .

> dumpbin /dependents "DB Browser for SQLCipher.exe"

Microsoft (R) COFF/PE Dumper Version 14.21.27702.2
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file DB Browser for SQLCipher.exe

File Type: EXECUTABLE IMAGE

  Image has the following dependencies:

    Qt5PrintSupport.dll
    Qt5Widgets.dll
    Qt5Network.dll
    Qt5Xml.dll
    sqlcipher.dll
    Qt5Gui.dll
    Qt5Core.dll
    MSVCP140.dll
    VCRUNTIME140.dll
    api-ms-win-crt-runtime-l1-1-0.dll
    api-ms-win-crt-string-l1-1-0.dll
    api-ms-win-crt-locale-l1-1-0.dll
    api-ms-win-crt-heap-l1-1-0.dll
    api-ms-win-crt-math-l1-1-0.dll
    api-ms-win-crt-stdio-l1-1-0.dll
    api-ms-win-crt-convert-l1-1-0.dll
    KERNEL32.dll

Возможно, вы обновили старую версию, как сказал Джастин? Можете ли вы удалить DB4S и выполнить чистую установку?

В разделе » Программы и компоненты» вы видите установленный пакет Microsoft Visual C++ <year> Redistributable ?

@justinclift @karim
Это был первый раз, когда я установил DB Browser. Раньше не устанавливалась более старая версия.
Сначала я начал с 64-битной версии, при подключении к https://download.sqlitebrowser.org/currentrelease возникла «Ошибка»
ошибка создания SS context () «ошибка.

Затем я удалил 64-битную версию через встроенный деинсталлятор Windows и после перезапуска (на всякий случай) установил 32-битную версию, чтобы проверить SQLCipher. Произошла ошибка отсутствующей библиотеки DLL.

Удалите снова, вернитесь к 64-битной версии и такому же отсутствующему ddl на SQLClipher.

Я действительно не могу вспомнить ни одной ошибки пользователя, которую я мог бы сделать. Я проверю Microsoft Visual C ++Распространяемый пакет, когда я вернусь домой.

Сначала я начал с 64-битной версии, появилась «Ошибка при
подключение к https://download.sqlitebrowser.org/currentrelease.
ошибка создания SS context () «ошибка.

>
Установите исходную 64-битную версию и получите «создание контекста ss»
ошибка. Как только вы это получите, нажмите OK, перейдите в Edit, нажмите Preferences и
сними ‘Проверять автоматические обновления’. Именно эта проверка вызывает
ошибка.
По крайней мере, это делает приложение пригодным для использования. Вернув эту опцию обратно
в удобное время, мы можем выяснить, что происходит, и посмотреть, сможем ли мы получить
вокруг этой проблемы И проблемы с DLL …

Я немного покопался в этом в песочнице Windows, используя ночную сборку от 29 июля 2019 года, и увидел вышеупомянутые проблемы. @karim Я копал немного дальше и использовал PEStudio, чтобы обнаружить, что msvcr120.dll используется как libeay32.dll ssleay32.dll, так что есть косвенное использование. надеюсь, это поможет

@glawrence Большое спасибо, вы правы! : смайлик:

Не знаю, как мы это упустили. Я проверил наш скрипт сборки и увидел, что библиотека OpenSSL не перестраивается каждый раз, когда мы собираем DB4S. Похоже, что он был построен один раз с использованием Visual Studio 2013, и мы используем его с тех пор. Это также влияет на наши последние стабильные и ночные игры.

@justinclift Вы можете это подтвердить?

Странно, что мы не получали об этой ошибке много сообщений. Возможно, у пользователей уже установлен Visual C ++ 2013 Redistributable, или они пытались исправить это сами, установив его.

Аааа, так вот откуда исходит зависимость.

@glawrence Вы

@karim Вполне возможно, что это так. Мы используем сборки выпуска OpenSSL 1.0.2 отсюда:

https://slproweb.com/products/Win32OpenSSL.html

Следует ли нам перекомпилировать установщики Win, чтобы включить в них модули слияния Redist Visual C ++ 2013?

Следует ли нам перекомпилировать установщики Win, чтобы включить в них модули слияния Redist Visual C ++ 2013?

Я не уверен, что включение двух Visual C ++ Redist будет хорошей идеей. Никогда не пробовал, но должно работать. Это добавит зависимости от Visual Studio 2013, поскольку каждая версия поставляется со своими собственными модулями слияния, и мы должны установить его, чтобы иметь возможность собирать DB4S.

Другой вариант — создать OpenSSL самостоятельно вместо использования двоичных файлов.

Есть и другие источники OpenSSL для Windows. Вышеупомянутый вариант — это именно то, что я выбрал сначала, поскольку это был 1-й вариант в списке на веб-сайте OpenSSL:

https://wiki.openssl.org/index.php/Binaries

Опция загрузки чуть ниже , что один называет себя:

«Предварительно скомпилированные библиотеки Win32 / 64 без внешних зависимостей от библиотек DLL среды выполнения Microsoft Visual Studio, за исключением системы, предоставленной msvcrt.dll».

При этом, возможно, было бы лучше просто создать OpenSSL самостоятельно. Не пробовал, поэтому не уверен, легко / сложно / и т. Д. : wink:

Другой вариант — создать вместо него LibreSSL , просто подумайте, как это может быть проще

Qt не поддерживает LibreSSL (https://bugreports.qt.io/browse/QTBUG-68374), поскольку кажется, что он работает только с OpenSSL (https://doc.qt.io/qt-5/ssl.html) .

Qt не поддерживает LibreSSL (https://bugreports.qt.io/browse/QTBUG-68374), поскольку кажется, что он работает только с OpenSSL (https://doc.qt.io/qt-5/ssl.html) .

Ах, тогда достаточно справедливо

Кстати, это блокировщик релизов для Windows?

Это происходит только в очень ограниченном сценарии …
По количеству загрузок, которые у нас есть, очень небольшое количество людей
затронуты. А отключив автопроверку, ошибка предотвращается. Не
идеальный обходной путь, но если они будут следить за сайтом, они увидят
следующий релиз … который выходит ТАК не часто.
Я бы лично не назвал это блокировщиком выпуска …

>

Да, возможно, мы это исправим в следующем выпуске. например, поэкспериментируйте с различными потенциальными реализациями OpenSSL — если не создадите нашу собственную — чтобы избавиться от этой дополнительной зависимости

У меня та же проблема и точно такое же сообщение об ошибке. в 32-битной версии Windows.

То, что я уже пробовал:

  • Сброс сети
  • Использование проводного подключения
  • переместите эти библиотеки в каталог: libeay32.dll, libssl32.dll и ssleay32.dll
  • проверил безопасность сети

Я действительно не знаю, что еще делать сейчас, я заблокирован для моей базы данных, к которой мне действительно нужно получить доступ как можно скорее.

Веб-сайт работает нормально, когда я помещаю его в браузер.

Пожалуйста, помогите кому-нибудь.

Я действительно не знаю, что еще делать сейчас
Я заблокирован для моей базы данных

Ошибка просто заключается в том, что DB4S проверяет наличие более новой версии и не может должным образом взаимодействовать с веб-сайтом. Это не должно влиять на остальную работу. Просто нажмите [OK], и ошибка исчезнет, ​​и DB4S продолжит работу. Если вы испытываете другие «симптомы» (например, закрытие DB4S), сообщите мне.

Вы можете устранить эту ошибку, перейдя в настройки и отключив автоматическую проверку. Однако затем рекомендуется посетить веб-сайт DB4S, чтобы проверить наличие обновлений вручную! ;)

перемещение этих библиотек

На самом деле ошибка уже есть в этих библиотеках, которые DB4S может найти, поэтому перемещение файлов, к сожалению, ничего не решает. Фактически, это просто вызовет больше проблем, поэтому я бы рекомендовал «отменить» любые манипуляции с файлами, которые вы выполняли.

Большое спасибо за вашу помощь, я очень ценю это. Наконец-то он заработал. Вы спасли мою жизнь :)

Мне все равно было бы интересно узнать, что заставило вас почувствовать, что DB4S блокирует вас из базы данных.
Это серьезный вопрос. Да, ошибку можно было бы обработать немного лучше, но что мы могли изменить, чтобы было очевидно, что это всего лишь предупреждение, а не полный сбой?
Рад, что у вас все заработало и вы попали в файл.

Была эта проблема сегодня. Я изначально предполагал то же, что и @AxnoratanxA. Ошибка является общей, поэтому я предположил, что она применима к общей функции приложения (не упоминается проверка обновлений, хотя, возможно, кто-то более умный сможет извлечь больше смысла из URL-адреса, чем я). Это также немедленно. Я привык к сообщению об ошибке, которое появляется в ответ на действие, которое я сознательно инициировал (запуск приложения), поэтому я предположил, что это ошибка, препятствующая нормальному запуску приложения. Теперь, когда ошибка известна, возможно, более удобное сообщение: «Не удалось подключиться к _URL_ при поиске обновления. Продолжайте использовать эту версию как обычно или установите Visual C ++ 2013 Redistributable с _DOWNLOAD URL_ ».

Я не уверен, что именно это было, но когда я удалил это:

JS: ScriptSH-inf [trj] daily.ldb

казалось, сработало. Мой антивирус поместил его в карантин, но мне удалось выяснить, где он находится, и удалить его. После этого не было ошибок при создании контекста SSL.

Теперь, когда ошибка известна, возможно, более удобное сообщение

Ошибка на самом деле вызвана библиотекой, поэтому мы, вероятно, не можем ее переформулировать, но (может быть?) Мы можем перехватить ее, а затем либо проигнорировать, либо отобразить более значимое сообщение.
В конечном итоге мы хотели бы полностью устранить ошибку, а не просто исправить ее, но пока мы пытались это сделать, это не дало 100% успеха.

Я столкнулся с той же проблемой. Я пробовал как 32-битную, так и 64-битную версии, но с той же ошибкой.

Как только вы получите сообщение об ошибке, нажмите «ОК», перейдите в «Редактировать», нажмите «Настройки» и снимите флажок «Проверять автоматические обновления». Эта проверка вызывает ошибку.
Просто проверьте на сайте вручную …

Или просто игнорируйте ошибку, так как она не причиняет никакого вреда.

Да, это помогло мне, это, вероятно, (надеюсь) сработает для вас

@chrisjlocke Спасибо за решение :-)

Кто-нибудь все еще получает эту ошибку? Если это так, пожалуйста, не исправляйте это и напишите здесь комментарий: smile: Я не думаю, что есть какой-либо способ исправить это, кроме как путем установки msvcr — но с некоторой помощью кого-то с этой ошибкой мы могли бы вычислить узнаем, как пока что показать лучшее сообщение об ошибке.

Да. Пользуюсь версией 3.11.2. Qt версии 5.7.1.

Я нашел параметр «Автоматические обновления» в разделе «Настройки» меню «Правка». Я только что снял галочку, и сообщение об ошибке больше не появляется.

Такая же проблема здесь, 3.11.2 с 5.7.1 — как в 32-, так и в 64-битной версии

Со мной тоже. Я никогда не пользовался этим приложением до сегодняшнего дня. Win10 x64, v3.11.2. Я использую Wi-Fi. Все браузеры отлично показывают URL. Я не использую прокси.

Привет Майк. Я вас знаю?

Боб

Нет, Боб, я не верю, что мы знаем друг друга. Я просто использую GitHub, чтобы ответить в ветке об открытой проблеме, которая все еще возникает. Вы также ответили в этой теме (впервые 4 октября 2019 г.). Вы можете отказаться от подписки на эту тему, если больше не хотите получать об этом электронные письма.

Ой. Хорошо. Теперь я это вижу. Благодарю. Хорошего дня.

Боб

@mviens Это все еще происходит с нашей последней ночной сборкой?

https://nightlies.sqlitebrowser.org/latest/

Мы готовимся к новому выпуску, и с 3.11.2 было внесено огромное количество изменений в код, в том числе некоторые, которые могли это исправить. : wink:

В целом, наш недавний выпуск 3.12.0-alpha1 и ночные сборки за последний месяц или около того должны быть намного лучше с этой проблемой. Они используют более новый внутренний компонент (OpenSSL v1.1.1), который кажется более надежным при подключении к нашему серверу загрузки.

@justinclift Как вы думаете, тогда мы сможем закрыть эту проблему? Или что-нибудь еще мы можем сделать в нашем коде, чтобы обсудить эту проблему?

Да. Пожалуйста, закройте вопрос.

Благодарю.

Боб

Потрясающе. Готово. :улыбка:

Update: Forum Guidelines & Code of Conduct

Qt World Summit: Early-Bird Tickets

This topic has been deleted. Only users with topic management privileges can see it.

  • I’m developing on Windows 10, and I get this error when creating desktop application.

    I’ve read and tried the recommendation in this link, Re: Ssl in application.. I’ve also read similar issues with similar recommendations with all kinds of google searches. I’m confused as ever because nowhere is there a clear and concise step-by-step solution.

    I get «Error creating SSL context()» with just a simple app to connect to a REST api. Here is the simple code, just trying to get a session token:

    QUrlQuery query;
    query.addQueryItem(QStringLiteral("userid"),   QStringLiteral("myname@myaddress"));
    query.addQueryItem(QStringLiteral("password"), QStringLiteral("mypassword"));
    
    QUrl url(QStringLiteral("https://www.somesite.com/api/login"));
    url.setQuery(query);
    
    m_reply = m_network_manager->get(QNetworkRequest(url));
    

    In the application output, I get this:

    qt.network.ssl: QSslSocket: cannot call unresolved function SSLv23_client_method
    qt.network.ssl: QSslSocket: cannot call unresolved function SSL_CTX_new
    qt.network.ssl: QSslSocket: cannot call unresolved function SSL_library_init
    qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
    qt.network.ssl: QSslSocket: cannot call unresolved function ERR_get_error
    

    What has to be done to make this work? Even worse, if I’ve got the dlls in the right place, then how to troubleshoot this error?

    Thanks.

  • @Snorkelbuckle

    Qt(binary packages) already provides DLLs(like libeay32.dll/ssleay32.dll) related to it. Put those DLLs within the execution path.

  • Can you identify specific file names and location that Qt binary package provides? I’ve searched my entire system and there are no files with those names. I’ve even installed something called OpenSSL-Win32 and there is nothing like that. The closest I got is libcrypto-1_1.dll and libssl-1_1.dll.

  • Okay, my search tool is not as good as I thought, I found those in C:QtToolsmingw530_32optbin and put into the execution path it works. Thank you for that.

    Now I have similar new problem. The only reason I was running the app on Windows was to understand why it won’t run on on Android :). So I know the code works as I expect, but now if I deploy to android, I get similar error and I guess I’m assuming same reason but how do I get this to work with Android?

    Invalid or empty cipher list (error:100000b1:SSL routines:OPENSSL_internal:NO_CIPHER_MATCH)
    

    And the application output:

    D ViewRootImpl@e6dadc9[QtActivity]: ViewPostIme pointer 0
    D InputMethodManager: HSIFW - flag : 0 Pid : 7843
    I InputMethodManager: hideSoftInputFromWindow ignore mServedView == null or mServedView.getWindowToken() != windowToken, mServedView :DecorView@21c6cce[QtActivity]
    D InputMethodManager: HSIFW - flag : 0 Pid : 7843
    I InputMethodManager: hideSoftInputFromWindow ignore mServedView == null or mServedView.getWindowToken() != windowToken, mServedView :DecorView@21c6cce[QtActivity]
    I zygote  : Do full code cache collection, code=125KB, data=104KB
    I zygote  : After code cache collection, code=119KB, data=86KB
    D ViewRootImpl@e6dadc9[QtActivity]: ViewPostIme pointer 1
    W linker  : library "libcrypto.so" ("/system/lib/libcrypto.so") needed or dlopened by "/data/app/org.qtproject.example.TestAndy2-lT_LT2h5WHkQMJr1VGzERw==/lib/arm/libQt5Core.so" is not accessible for the namespace "classloader-namespace" - the access is temporarily granted as a workaround for http://b/26394120, note that the access will be removed in future releases of Android.
    Could not load shared library symbols for /system/lib/libcrypto.so.
    Do you need "set solib-search-path" or "set sysroot"?
    W linker  : library "libssl.so" ("/system/lib/libssl.so") needed or dlopened by "/data/app/org.qtproject.example.TestAndy2-lT_LT2h5WHkQMJr1VGzERw==/lib/arm/libQt5Core.so" is not accessible for the namespace "classloader-namespace" - the access is temporarily granted as a workaround for http://b/26394120, note that the access will be removed in future releases of Android.
    Could not load shared library symbols for /system/lib/libssl.so.
    Do you need "set solib-search-path" or "set sysroot"?
    W libTestAndy2.so: (null):0 ((null)): qt.network.ssl: QSslSocket: cannot resolve CRYPTO_free
    W libTestAndy2.so: (null):0 ((null)): qt.network.ssl: QSslSocket: cannot resolve CONF_get1_default_config_file
    W libTestAndy2.so: (null):0 ((null)): qt.network.ssl: QSslSocket: cannot resolve EC_curve_nist2nid
    W libTestAndy2.so: (null):0 ((null)): qt.network.ssl: QSslSocket: cannot resolve SSL_CTX_ctrl
    W libTestAndy2.so: (null):0 ((null)): qt.network.ssl: QSslSocket: cannot resolve SSL_CONF_CTX_new
    W libTestAndy2.so: (null):0 ((null)): qt.network.ssl: QSslSocket: cannot resolve SSL_CONF_CTX_free
    W libTestAndy2.so: (null):0 ((null)): qt.network.ssl: QSslSocket: cannot resolve SSL_CONF_CTX_set_ssl_ctx
    W libTestAndy2.so: (null):0 ((null)): qt.network.ssl: QSslSocket: cannot resolve SSL_CONF_CTX_set_flags
    W libTestAndy2.so: (null):0 ((null)): qt.network.ssl: QSslSocket: cannot resolve SSL_CONF_CTX_finish
    W libTestAndy2.so: (null):0 ((null)): qt.network.ssl: QSslSocket: cannot resolve SSL_CONF_cmd
    D NetworkSecurityConfig: No Network Security Config specified, using platform default
    I zygote  : Do partial code cache collection, code=123KB, data=88KB
    I zygote  : After code cache collection, code=123KB, data=88KB
    I zygote  : Increasing code cache capacity to 512KB
    W libTestAndy2.so: (null):0 ((null)): qt.network.ssl: QSslSocket: cannot call unresolved function SSL_CTX_ctrl
    

    Thank you.

  • Thank you for that. I’ve managed to get through 90% of the instructions. I’m at step 8 in which I must run make to build the libraries. Only problem is I don’t have make on my system, it is windows environment. I’m using msys2.

    Do I need to install make in msys2 environment? Then what about compiler, what compiler do I use?

    Thanks.

  • I installed make into msys2 and ran make and I guess I don’t need to worry about compiler, it is using whatever is provided by the android sdk. However, I now have a new hurdle. It can’t find assert.h. Which assert.h is it wanting, shouldn’t the setup script have added the right paths needed for building?

    Is this the location of assert.h that is needed?

    C:UsersJosedeLeonAppDataLocalAndroidSdkndk-bundlesysrootusrinclude
    

    Here is the output from setup script

    ANDROID_NDK_ROOT: /c/Users/JosedeLeon/AppData/Local/Android/Sdk/ndk-bundle
    ANDROID_ARCH: arch-arm64
    ANDROID_EABI: aarch64-linux-android-4.9
    ANDROID_API: android-28
    ANDROID_SYSROOT: /c/Users/JosedeLeon/AppData/Local/Android/Sdk/ndk-bundle/platforms/android-28/arch-arm64
    ANDROID_TOOLCHAIN: /c/Users/JosedeLeon/AppData/Local/Android/Sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/windows-x86_64/bin
    FIPS_SIG:
    CROSS_COMPILE: aarch64-linux-android-
    ANDROID_DEV: /c/Users/JosedeLeon/AppData/Local/Android/Sdk/ndk-bundle/platforms/android-28/arch-arm64/usr
    

    Here is the error

    $ make CALC_VERSIONS="SHLIB_COMPAT=; SHLIB_SOVER=" build_libs
    make depend && make _build_libs
    make[1]: Entering directory '/c/Users/JosedeLeon/Documents/Development/Tools/Libraries/openssl-1.1.0i'
    make[1]: Leaving directory '/c/Users/JosedeLeon/Documents/Development/Tools/Libraries/openssl-1.1.0i'
    make[1]: Entering directory '/c/Users/JosedeLeon/Documents/Development/Tools/Libraries/openssl-1.1.0i'
    aarch64-linux-android-gcc  -I. -Icrypto/include -Iinclude -DDSO_DLFCN -DHAVE_DLFCN_H -DNDEBUG -DOPENSSL_THREADS -DOPENSSL_NO_STATIC_ENGINE -DOPENSSL_PIC -DOPENSSLDIR=""/usr/local/ssl"" -DENGINESDIR=""/usr/local/lib/engines-1.1"" -Wall -O3 -pthread -mandroid -fPIC --sysroot=/c/Users/JosedeLeon/AppData/Local/Android/Sdk/ndk-bundle/platforms/android-28/arch-arm64 -Wa,--noexecstack  -fPIC -DOPENSSL_USE_NODELETE -MMD -MF crypto/aes/aes_core.d.tmp -MT crypto/aes/aes_core.o -c -o crypto/aes/aes_core.o crypto/aes/aes_core.c
    crypto/aes/aes_core.c:39:20: fatal error: assert.h: No such file or directory
     #include <assert.h>
                        ^
    compilation terminated.
    make[1]: *** [Makefile:678: crypto/aes/aes_core.o] Error 1
    make[1]: Leaving directory '/c/Users/JosedeLeon/Documents/Development/Tools/Libraries/openssl-1.1.0i'
    make: *** [Makefile:132: build_libs] Error 2
    
    

    Thanks.

  • @Devopia53

    Okay, finally got it to work but what a big pain. I think the main problem is that the guide is out of date and it needs to mention how specific environments need to resolve any issues that come up. Just a quick search online shows that there are common problems that everybody seems to be going through just to get Qt and OpenSSL to work with Android or otherwise.

    For the record this is what I had to do, and the discovery process was not fun, here are the errors I came across in order:

    ERROR 1: can’t find headers

    RESOLUTION: Something is wrong with the latest android NDK. I was using r17b. I downloaded and instead used r14b. Maybe I didn’t need to go that far back, but the issue is the location of include and libraries are changed. Go download older version of NDK.

    ERROR 2: «CreateProcess: No such file or directory».

    RESOLUTION: Stupid windows file limitations. Go move the openssl source directory to top level on your HD. The issue is the paths were too long in windows.

    ERROR 3: Something about incompatible version of libssl or some such.

    RESOLUTION: You’ll see the message in the application log. Downgrade your openssl package. I started with openssl-1.1.0i. I reverted to openssl-1.0.2p.

    ERROR 4: 64-bit version wrong version. Can’t remember the exact message, you’ll find it in the application output log and you will recognize the error easily.

    RESOLUTION: Be aware of your environment, 32bit vs 64bit. The guide gives example for 64 bit arch. Instead, build for 32 bit architecture. Unless your build environment is already set for 64 bit, then I don’t have any advice.

    Thank you!

  • check out this video for ssl context error fix
    https://www.youtube.com/watch?v=nsPrI0aSkoI

After the launch of Android 8.0, our QT App is not working properly on devices with this new version. The error we are seeing in our emulator is «Error creating SSL context ()». The app runs normally, but when it tries to make a HTTP call it fails.

We have this line in our AndroidManifest:

<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="23"/>

I have tried to change this targetSdkVersion sometimes, but nothing works.

Also, we make the HTTP call using this function

void UrlLoader::load()
{
    this->setProperty("loading", true);
    QNetworkRequest request;
    request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
    request.setUrl(m_url);

    QUrlQuery postData;

    if(params() != "") {
        QStringList pieces = params().split( "&" );
        foreach(QString value, pieces) {
            QStringList values = value.split( "=" );
            postData.addQueryItem(values[0], values[1]);
        }
    }

    m_netMan->post(request, postData.toString(QUrl::FullyEncoded).toUtf8());
}

The error is shown when we try to read the result:

void UrlLoader::finished(QNetworkReply *reply)
{
    this->setProperty("loading", false);
    QJsonArray jsonArray;
    QJsonObject json;
    int error = reply->error();

    if(error == 0){
        QByteArray rawData = reply->readAll();
        if(QJsonDocument::fromJson(rawData).isArray()) {
            jsonArray = QJsonDocument::fromJson(rawData).array();
            emit this->loadedArray(jsonArray);
        } else {
            json = QJsonDocument::fromJson(rawData).object();
            if(json.empty()){
                this->setResponse(rawData);
            }
            emit this->loaded(json);
        }
        reply->abort ();
    } else {
        emit this -> crashed(this -> retornaError(error)) ;
    }
}

Can someone help us?
Best Regards.

  • Ошибка создания контейнера uid ключей
  • Ошибка создания компоненты браузера
  • Ошибка создания ключевой пары 1с отчетность
  • Ошибка создания ключевой пары 0x8010006c
  • Ошибка создания ключевой пары 0x80090023