maplibre / maplibre-native-qt

MapLibre Native Qt Bindings and Qt Location Plugin
https://maplibre.org/maplibre-native-qt/docs/
38 stars 14 forks source link

maplibregl and Versatiles #31

Closed petricf closed 3 weeks ago

petricf commented 1 year ago

Describe the bug Use Versatiles with maplibregl

To Reproduce Steps to reproduce the behavior:

  1. Configure qml Map
  2. Start
  3. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots Terminal Output (started under QtCreator):

QML debugging is enabled. Only use this in a safe environment.
[ INFO ]  "{unknown}[General]: GPU Identifier: Mesa Intel(R) HD Graphics 530 (SKL GT2)"
qt.tlsbackend.ossl: Incompatible version of OpenSSL (built with OpenSSL 1.x, runtime version is >= 3.x)
qt.network.ssl: The backend "cert-only" does not support QSslKey 
qt.network.ssl: Active TLS backend does not support key creation
qt.network.ssl: The backend "cert-only" does not support QSslKey
qt.network.ssl: Active TLS backend does not support key creation
qt.network.ssl: The backend "cert-only" does not support QSslKey
qt.network.ssl: Active TLS backend does not support key creation
qt.network.ssl: The backend "cert-only" does not support QSslKey
qt.network.ssl: Active TLS backend does not support key creation
qt.network.ssl: The backend "cert-only" does not support QSslKey
qt.network.ssl: Active TLS backend does not support key creation
qt.network.ssl: The backend "cert-only" does not support QSslKey
qt.network.ssl: Active TLS backend does not support key creation
qt.network.ssl: The backend "cert-only" does not support QSslSocket
qt.network.ssl: The backend named "cert-only" does not support TLS
qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed
[ ERROR ]  "{unknown}[Setup]: loading style failed: TLS initialization failed"
qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed
[ ERROR ]  "{unknown}[Setup]: loading style failed: TLS initialization failed"
qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed
[ ERROR ]  "{unknown}[Setup]: loading style failed: TLS initialization failed"
qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed
[ ERROR ]  "{unknown}[Setup]: loading style failed: TLS initialization failed"
...

Platform information (please complete the following information):

Additional context qml-code (hopefully relevant part):

Plugin {
    id: mapPlugin
    name: "maplibregl"
      PluginParameter { name: "maplibregl.mapping.additional_style_urls"; value: "http://192.168.2.44/api/tiles.json" }
}

Map {
    id: map
    anchors.fill: parent
    plugin: mapPlugin
    center: QtPositioning.coordinate(48.79, 9.1) // somewhere in Germany
    zoomLevel: 14
    minimumZoomLevel: 2
    maximumZoomLevel: 18
}

It seems there is a ssl version mismatch.

How to overcome this ?

ntadej commented 1 year ago

Do you use Qt distributed officially or the one from Debian?

petricf commented 1 year ago

Hello,

Am Dienstag, 22. August 2023, 16:28:44 CEST schrieb Tadej Novak:

Do you use Qt distributed officially or the one from Debian?

Stock Debian 12 + Plasma WM Qt5 from Debian Qt 6 from Qt-Online Installer (qt.io) + QtCreator versions 6.4.3 and 6.5.2

The Online Installer installs to ~/Qt

Program debugged in QtCreator IDE.

kind regards Petric

ntadej commented 1 year ago

I guess I'll have to debug. I was not even aware we link directly with SSL.

Does any of the Qt network examples work?

petricf commented 1 year ago

I guess I'll have to debug. I was not even aware we link directly with SSL.

Does any of the Qt network examples work?

The http-example does also not work. The output:

qt.tlsbackend.ossl: Incompatible version of OpenSSL (built with OpenSSL 1.x, runtime version is >= 3.x)
qt.network.ssl: The backend "cert-only" does not support QSslKey
qt.network.ssl: Active TLS backend does not support key creation
qt.network.ssl: The backend "cert-only" does not support QSslKey
qt.network.ssl: Active TLS backend does not support key creation
qt.network.ssl: The backend "cert-only" does not support QSslKey
qt.network.ssl: Active TLS backend does not support key creation
qt.network.ssl: The backend "cert-only" does not support QSslKey
qt.network.ssl: Active TLS backend does not support key creation
qt.network.ssl: The backend "cert-only" does not support QSslKey
qt.network.ssl: Active TLS backend does not support key creation
qt.network.ssl: The backend "cert-only" does not support QSslKey
qt.network.ssl: Active TLS backend does not support key creation
qt.network.ssl: The backend "cert-only" does not support QSslSocket
qt.network.ssl: The backend named "cert-only" does not support TLS
qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed

So it seems to be a problem at my side (or qt.io compiled the ssl-plugin for v1 ssl)

Any idea how to install openssl v1 additionally on debian (if that helps) ?

ntadej commented 1 year ago

It seems that the new debian does not ship with 1.1 anymore: https://packages.debian.org/search?keywords=libssl1.1

I'm working on Qt 6.5 and 6.6 support (but it will take some more time) that AFAIK uses OpenSSL 3.

petricf commented 1 year ago

Feedback: libssl 1.1 and openssl 1 debs of Bookworm downloaded and installed.

Result: Its working.

The QML-File mapping part:

Plugin {
    id: mapPlugin
    name: "maplibregl"
      PluginParameter { name: "maplibregl.mapping.additional_style_urls"; value: "https://tiles.versatiles.org/styles/colorful.json" }
      PluginParameter { name: "maplibregl.api_base_url"; value: "https://tiles.versatiles.org:8080/api" }
}

Map {
    id: map
    anchors.fill: parent
    plugin: mapPlugin
    center: QtPositioning.coordinate(48.79, 9.1) // irgendwo in Deutschland
    zoomLevel: 14
    minimumZoomLevel: 2
    maximumZoomLevel: 18

Versatiles (https://versatiles.org/) is a new free open tile server initiative based on OpenStreetMap data. It requires much less space and cpu power on an own tile server installation. On the web page there is a presentation held at the last CCC congress (in german).

Can't wait for the Qt 6.5.x adaption ;-) Is it possible to get a notification when it is released, maybe also for testing.

emericg commented 9 months ago

I can confirm that Versatiles works with maplibre-native-qt. I tested on Android as well, were using https://github.com/KDAB/android_openssl is indeed required so we don't see the same SSL errors as this issue originally mentioned.

ntadej commented 3 weeks ago

I will close this ticket for now. 3.0 will be released by the end of the month.