opengisch / QField

A simplified touch optimized interface for QGIS
http://www.qfield.org
GNU General Public License v2.0
843 stars 230 forks source link

Error loading wms layer #5497

Open kiri03 opened 4 months ago

kiri03 commented 4 months ago

Describe the issue

I have a project in QGIS where everything is displayed correctly, including several WMS layers, but when I send that project to QField there is a specific layer that is not displayed and an error related to the SSL certificate appears:

Map request failed [error: SSL handshake failed: The issuer certificate of a locally looked up certificate could not be found url: https://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx?

I have deleted all the layers leaving only the layer with the WMS layer and still nothing is displayed in QField, the same error appears. I attach the QGZ file with the WMS layer to be able to reproduce the error in QField and see if someone can provide me with a solution.)

Catastro_Spain.zip

Desktop (please complete the following information)

Mobile (please complete the following information)

nirvn commented 4 months ago

@kiri03 , when I load this locally in QGIS, I get the following dialog:

image

These custom certificates aren't supported by QField (yet).

nirvn commented 4 months ago

Loading the URL on a browser also reveals a problematic certificate:

image

kiri03 commented 4 months ago

I don't understand it. When I open that project in QGIS it opens perfectly without any error message. And in the mentioned link I also open it perfectly. Captura Captura2

nirvn commented 4 months ago

@kiri03 , have you tried a/ opening the URL (https://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx) in your browser, and b/ opening the project in a new QGIS profile? It's possible you accepted the custom certificate a long time ago.

kiri03 commented 3 months ago

I tried putting that link on a new computer and no error appears. This is what appears: Captura2

nirvn commented 3 months ago

@kiri03 , are you typing in the https URL?

kiri03 commented 3 months ago

This link: https://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx

nirvn commented 3 months ago

@kiri03 , OK, I see it works with Chrome but not with Firefox. Curious.

nirvn commented 3 months ago

We're using the Mozilla CA certificate store in QField, and it seems they have removed Firmaprofesional as a trusted certifier.

Running the website against an online SSL checker does reveal the certificate is not universally accepted:

image

kiri03 commented 3 months ago

The original problem is that the Spanish cadastre WMS layers all work in QGIS, however they do not load in QField. Could someone from the QField development team fix this problem?

nirvn commented 3 months ago

@kiri03 , you said it works with a VPN? Can we close this?

kiri03 commented 3 months ago

No, I'm not using VPN. Te project open perfectly in QGIS but not in QField.

nirvn commented 3 months ago

@kiri03 , ok. What version of QGIS are you using?

kiri03 commented 3 months ago

QGIS 3.38.1 all the information is indicated at the beginning of this thread

kiri03 commented 3 months ago

QField 3.3.8

kiri03 commented 3 months ago

I hope this issue will be fixed in a future version of QField.

kiri03 commented 3 months ago

QField 3.3.9 released and the problem with this WMS layer persist.

m-kuhn commented 3 months ago

Looks like mozilla has accepted Firmaprofesional 2 months ago https://bugzilla.mozilla.org/show_bug.cgi?id=1785215

nirvn commented 3 months ago

@m-kuhn , good catch. We'll have to wait until curl's CA certificates extract to catch up then (see https://curl.se/docs/caextract.html).

I will say though that I'm on Firefox nightly, and that WMS server is still giving me a SEC_ERROR_UNKNOWN_ISSUER error code.

m-kuhn commented 3 months ago

Interesting as it says

Successfully tested in Nightly 128.0a1 (2024-06-09) (64-bit)

Screenshot 2024-08-10 at 11 53 41
m-kuhn commented 3 months ago

@kiri03 ideally you can reach out to the WMS provider and inform them that their SSL certificate is not accepted by mozilla / on firefox.

Screenshot 2024-08-10 at 12 00 06

The only thing which could potentially be done on QField side is to add an SSL exception management.

m-kuhn commented 3 months ago

For reference, this is the test page for firmaprofesional and it is working: https://testsslev2022ec.firmaprofesional.com/ so it has been added, but did not fix the issue here.

The cert has been signed by a different CA (visible in the security details of both pages). This is definitely best solved through catastro.meh.es directly.

kiri03 commented 3 months ago

I don't quite understand the proposed solution. Does that mean that the problem cannot be solved from within Qfield's own development by modifying the program?

m-kuhn commented 3 months ago

This means that this problem is best solved on server side and therefore best if you could make the Spanish authorities aware of that. The fact that it's not working in Firefox -- which is a major, state of the art web browser -- should be good enough for their technical staff to assess the source of the problem.

The problem could also be circumvented from within QField but it requires a non trivial amount of work.

kiri03 commented 3 months ago

Thank you very much for the reply. Now everything is clear.

kiri03 commented 3 months ago

I just installed Mozilla Firefox and tried the address: https://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx?

I don't get any SSL certificate error and the page opens normally, just like in Chrome or Edge:

Imagen3

m-kuhn commented 3 months ago

It also works for me on linux, but not on macos with firefox nightly. I guess on linux it uses a different set of CA.

nirvn commented 3 months ago

@m-kuhn , to add to the mystery: it does not work for me on linux (using Firefox nightly) on Ubuntu 24.04.

kiri03 commented 1 month ago

This means that this problem is best solved on server side and therefore best if you could make the Spanish authorities aware of that. The fact that it's not working in Firefox -- which is a major, state of the art web browser -- should be good enough for their technical staff to assess the source of the problem.

The problem could also be circumvented from within QField but it requires a non trivial amount of work.

I contacted the cadastre registry service in Spain (https://www.sedecatastro.gob.es/) and the answer I got was that TLS 1.0 and 1.1 have recently been disabled. I don't know exactly what this means and if there is a simple solution. Thanks

m-kuhn commented 1 month ago

Interesting, I just checked with Firefox 130.0.1