qgiscloud / qgis-cloud-plugin

QGIS Plugin for publishing maps on www.qgiscloud.com
GNU General Public License v2.0
18 stars 13 forks source link

SSL Problems on Windows #54

Open mlbrack opened 3 years ago

mlbrack commented 3 years ago

One day, Cloud Plugin worked, next day it didn't.

Returning python error on attempted logon.

Uninstalled all QGIS and python. Reinstalled. Plugin still failing.

Error info:

An error has occurred while executing Python code:

urllib.error.URLError: Traceback (most recent call last): File "C:\OSGeo4W\apps\Python39\lib\urllib\request.py", line 1346, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "C:\OSGeo4W\apps\Python39\lib\http\client.py", line 1253, in request self._send_request(method, url, body, headers, encode_chunked) File "C:\OSGeo4W\apps\Python39\lib\http\client.py", line 1299, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "C:\OSGeo4W\apps\Python39\lib\http\client.py", line 1248, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "C:\OSGeo4W\apps\Python39\lib\http\client.py", line 1008, in _send_output self.send(msg) File "C:\OSGeo4W\apps\Python39\lib\http\client.py", line 948, in send self.connect() File "C:\OSGeo4W\apps\Python39\lib\http\client.py", line 1422, in connect self.sock = self._context.wrap_socket(self.sock, File "C:\OSGeo4W\apps\Python39\lib\ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "C:\OSGeo4W\apps\Python39\lib\ssl.py", line 1040, in _create self.do_handshake() File "C:\OSGeo4W\apps\Python39\lib\ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ssl.SSLError: A failure in the SSL library occurred (_ssl.c:1129)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users/mbrack/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgiscloud\qgiscloudplugindialog.py", line 411, in check_login raise e File "C:\Users/mbrack/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgiscloud\qgiscloudplugindialog.py", line 331, in check_login login_info = self.api.check_login( File "C:\Users/mbrack/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgiscloud\qgiscloudapi\qgiscloudapi.py", line 161, in check_login content = request.post(resource, data) File "C:\Users/mbrack/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgiscloud\qgiscloudapi\qgiscloudapi.py", line 596, in post return self.request(resource, method='POST', data=data) File "C:\Users/mbrack/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgiscloud\qgiscloudapi\qgiscloudapi.py", line 684, in request response = urllib.request.urlopen(req).read() File "C:\OSGeo4W\apps\Python39\lib\urllib\request.py", line 214, in urlopen return opener.open(url, data, timeout) File "C:\OSGeo4W\apps\Python39\lib\urllib\request.py", line 517, in open response = self._open(req, data) File "C:\OSGeo4W\apps\Python39\lib\urllib\request.py", line 534, in _open result = self._call_chain(self.handle_open, protocol, protocol + File "C:\OSGeo4W\apps\Python39\lib\urllib\request.py", line 494, in _call_chain result = func(*args) File "C:\OSGeo4W\apps\Python39\lib\urllib\request.py", line 1389, in https_open return self.do_open(http.client.HTTPSConnection, req, File "C:\OSGeo4W\apps\Python39\lib\urllib\request.py", line 1349, in do_open raise URLError(err) urllib.error.URLError:

Python version: 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] QGIS version: 3.20.3-Odense Odense, 495fbaec

Python Path: C:/OSGeo4W/apps/qgis/./python C:/Users/mbrack/AppData/Roaming/QGIS/QGIS3\profiles\default/python C:/Users/mbrack/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins C:/OSGeo4W/apps/qgis/./python/plugins C:\OSGeo4W\bin\python39.zip C:\OSGeo4W\apps\Python39\DLLs C:\OSGeo4W\apps\Python39\lib C:\OSGeo4W\bin C:\OSGeo4W\apps\Python39 C:\OSGeo4W\apps\Python39\lib\site-packages C:\OSGeo4W\apps\Python39\lib\site-packages\win32 C:\OSGeo4W\apps\Python39\lib\site-packages\win32\lib C:\OSGeo4W\apps\Python39\lib\site-packages\Pythonwin C:/Users/mbrack/AppData/Roaming/QGIS/QGIS3\profiles\default/python

tpo commented 3 years ago

Hello @mlbrack - does the problem still occur? If yes, then could you please take this to QGIS Cloud Support?

mlbrack commented 3 years ago

Yes, still fails. Thanks. Just started a ticket.

HusseinKabbout commented 3 years ago

It seems that setting SSL_CERT_FILE environment variable fixes this problem.

This is how I set the SSL_CERT_FILE variable:

  1. In QGIS go to Settings/options
  2. Then go to the System Tab
  3. Unter Environment check the checkbox and add a new entry like the following picture:

image

The path might be slightly different for you, since you probably installed QGIS somewhere else.

But this workaroudn only works in the upcomming QGIS version 3.22.0.

mlbrack commented 3 years ago

Interesting. So this is a known problem?

I have two machines that are identical in OS and QGIS installs. One is failing. One is not.

Thanks for the info.

HusseinKabbout commented 3 years ago

Interesting. So this is a known problem?

I just found this workaround today. I don't know if this is a known problem.

I have two machines that are identical in OS and QGIS installs. One is failing. One is not.

Are you sure that the QGIS versions are identical? Can you send a screenshot of both Version dialogs?

mlbrack commented 3 years ago

My QGIS versions aren’t identical anymore from various installs/uninstalls to test.

This occurred in 3.16 updated to 3.20 to try to resolve. Updated, uninstalled, reinstalled cloud plugin.

In jpgs, the 3.20.3 is the machine that is getting the python error.

tpo commented 3 years ago

Similar past problem on OSX, due to missing cert.pem file in package: #36

tpo commented 3 years ago

@HusseinKabbout suggest, that this might be related to https://github.com/qgis/QGIS/issues/45377 but I think that's a different problem (namely version.qgis.org having a mess with their certificates).

tpo commented 3 years ago

According to @HusseinKabbout this is the problem:

tpo commented 3 years ago

@mlbrack could you please test if the new development build https://qgis.org/downloads/QGIS-OSGeo4W-3.22.0-1.msi fixes your problem?

HusseinKabbout commented 3 years ago

I have tested both QGIS 3.16.12 and QGIS 3.22.0 and they are working now for me. @mlbrack can you confirm this and close this issue?

mlbrack commented 3 years ago

I have uninstalled all and reinstalled 3.22.0 Uninstalled and reinstalled qgis cloud plugin. Ran using default and ran using manually configured SSL_CERT_FILE. Used standalone installer and OSGEO4W installer.

All returns the same set of errors.

An error has occurred while executing Python code:

urllib.error.URLError: Traceback (most recent call last): File "C:\OSGeo4W\apps\Python39\lib\urllib\request.py", line 1346, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "C:\OSGeo4W\apps\Python39\lib\http\client.py", line 1253, in request self._send_request(method, url, body, headers, encode_chunked) File "C:\OSGeo4W\apps\Python39\lib\http\client.py", line 1299, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "C:\OSGeo4W\apps\Python39\lib\http\client.py", line 1248, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "C:\OSGeo4W\apps\Python39\lib\http\client.py", line 1008, in _send_output self.send(msg) File "C:\OSGeo4W\apps\Python39\lib\http\client.py", line 948, in send self.connect() File "C:\OSGeo4W\apps\Python39\lib\http\client.py", line 1422, in connect self.sock = self._context.wrap_socket(self.sock, File "C:\OSGeo4W\apps\Python39\lib\ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "C:\OSGeo4W\apps\Python39\lib\ssl.py", line 1040, in _create self.do_handshake() File "C:\OSGeo4W\apps\Python39\lib\ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ssl.SSLError: A failure in the SSL library occurred (_ssl.c:1129)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users/mbrack/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgiscloud\qgiscloudplugindialog.py", line 411, in check_login raise e File "C:\Users/mbrack/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgiscloud\qgiscloudplugindialog.py", line 331, in check_login login_info = self.api.check_login( File "C:\Users/mbrack/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgiscloud\qgiscloudapi\qgiscloudapi.py", line 161, in check_login content = request.post(resource, data) File "C:\Users/mbrack/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgiscloud\qgiscloudapi\qgiscloudapi.py", line 596, in post return self.request(resource, method='POST', data=data) File "C:\Users/mbrack/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgiscloud\qgiscloudapi\qgiscloudapi.py", line 684, in request response = urllib.request.urlopen(req).read() File "C:\OSGeo4W\apps\Python39\lib\urllib\request.py", line 214, in urlopen return opener.open(url, data, timeout) File "C:\OSGeo4W\apps\Python39\lib\urllib\request.py", line 517, in open response = self._open(req, data) File "C:\OSGeo4W\apps\Python39\lib\urllib\request.py", line 534, in _open result = self._call_chain(self.handle_open, protocol, protocol + File "C:\OSGeo4W\apps\Python39\lib\urllib\request.py", line 494, in _call_chain result = func(*args) File "C:\OSGeo4W\apps\Python39\lib\urllib\request.py", line 1389, in https_open return self.do_open(http.client.HTTPSConnection, req, File "C:\OSGeo4W\apps\Python39\lib\urllib\request.py", line 1349, in do_open raise URLError(err) urllib.error.URLError:

Python version: 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] QGIS version: 3.22.0-Białowieża Białowieża, d9022691f1

Python Path: C:/OSGeo4W/apps/qgis/./python C:/Users/mbrack/AppData/Roaming/QGIS/QGIS3\profiles\default/python C:/Users/mbrack/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins C:/OSGeo4W/apps/qgis/./python/plugins C:\OSGeo4W\bin\python39.zip C:\OSGeo4W\apps\Python39\DLLs C:\OSGeo4W\apps\Python39\lib C:\OSGeo4W\bin C:\OSGeo4W\apps\Python39 C:\OSGeo4W\apps\Python39\lib\site-packages C:\OSGeo4W\apps\Python39\lib\site-packages\win32 C:\OSGeo4W\apps\Python39\lib\site-packages\win32\lib C:\OSGeo4W\apps\Python39\lib\site-packages\Pythonwin C:/Users/mbrack/AppData/Roaming/QGIS/QGIS3\profiles\default/python

HusseinKabbout commented 3 years ago

After uninstalling QGIS make sure that the directory, where QGIS was previously installed, is empty. I have had some cases where the QGIS uninstaller didn't clean up all files/dlls. @mlbrack

mlbrack commented 3 years ago

Uninstalled again removing all QGIS related and reinstalled.

Still getting error.

HusseinKabbout commented 3 years ago

How are you installing QGIS?I have tested the newest QGIS releases (https://qgis.org/en/site/forusers/download.html) 3.22.0 / 3.16.12 again and it still works for me. I installed QGIS via the standalone installer.

mlbrack commented 3 years ago

I've installed with both the standalone and the network installer.

HusseinKabbout commented 3 years ago

Uninstalled again removing all QGIS related and reinstalled.

Still getting error.

When you say that you deleted all QGIS related, do you mean only your QGIS projects or also the QGIS installtion directory? For example what I did is the following:

  1. Delete QGIS under C:\Program Files x86\QGIS (This was were I installed QGIS)
  2. Install QGIS in an empty directory

With this it should work with both QGIS 3.22.0 and QGIS 3.16.12. I have tested this with multiple machines (Windows 10).

mlbrack commented 3 years ago

Aside from going into the registry, deleting all QGIS related files and folders.

tpo commented 3 years ago

@mlbrack

Aside from going into the registry, deleting all QGIS related files and folders

The point of the matter is: is there a library left from previous installations, that gets used?

As far as I understand the issue, the problem is that OSGEO's build for QGIS 3.20 was misconfigured and produced libraries that broke openssl's certificate search path. Thus when making a HTTPS connection from the QGIS Cloud Plugin, openssl would not find the CA certificates required to verify the certificate presented by qgiscloud.com.

Further on, when re-installing QGIS, the (de)installer would not properly deinstall the misbuilt openssl libraries. Therefore, even if you deinstalled QGIS 3.20 a subsequent QGIS 3.16 or 3.22 installation would still use the misbuild libraries from the previous - nominally deinstalled - QGIS 3.16 installation.

Unfortunately I have no access to a Windows Installation, thus I can not give you precise instructions, but the idea would be to see if there are anywhere old openssl libraries or libraries from the QGIS installation still lying around in your filesystem and if there are, then delete those, before reinstalling another QGIS.

That's roughly the idea.

mlbrack commented 3 years ago

That's what I've interpreted from all the techno-talk.

I am at a loss to understand/find what could be "anywhere old openssl libraries or libraries from the QGIS installation still lying around in your filesystem"

I am manually deleting all of the QGIS-related files and folders that I know of.

I don't know what else to do.

ralfWessels commented 2 years ago

Hi, also have this SSL Problems with QGIS version 3.22.2 (msi installation) on windows 11 uninstalled the previous version 3.22.1, deleted the folder 'C:\Program Files\QGIS 3.22.2' and installed the new version, but still can't login with the QGIS Cloud-Plugin. Is there meanwhile a solution for this problem?

best greetings from Berlin ralf

mhugent commented 2 years ago

@ralfWessel : unfortunately we don't know when this problem appears. We don't have that problem on all our windows machines, but it is something which pops up frequently. It would be great to have the possibility to look on a machine where that happens to better undestand what the problem is. Would you be available for a jitsi video session where you could share your screen? Please contact me by mail ( mhugent at sourcepole dot ch)

mhugent commented 2 years ago

It works now for Ralf, but unfortunately we don't know why :-(

aviborg commented 2 years ago

It seems that setting SSL_CERT_FILE environment variable fixes this problem.

This is how I set the SSL_CERT_FILE variable:

  1. In QGIS go to Settings/options
  2. Then go to the System Tab
  3. Unter Environment check the checkbox and add a new entry like the following picture:

image

The path might be slightly different for you, since you probably installed QGIS somewhere else.

But this workaroudn only works in the upcomming QGIS version 3.22.0.

Got this in 3.26.2. Installed on two computers and one worked and one failed. The difference was that I ticked everything on the setup screen on the failing computer.

2022-08-28T18:56:40     WARNING    Traceback (most recent call last):
              File "C:\OSGeo4W\apps\Python39\lib\urllib\request.py", line 1346, in do_open
              h.request(req.get_method(), req.selector, req.data, headers,
              File "C:\OSGeo4W\apps\Python39\lib\http\client.py", line 1253, in request
              self._send_request(method, url, body, headers, encode_chunked)
              File "C:\OSGeo4W\apps\Python39\lib\http\client.py", line 1299, in _send_request
              self.endheaders(body, encode_chunked=encode_chunked)
              File "C:\OSGeo4W\apps\Python39\lib\http\client.py", line 1248, in endheaders
              self._send_output(message_body, encode_chunked=encode_chunked)
              File "C:\OSGeo4W\apps\Python39\lib\http\client.py", line 1008, in _send_output
              self.send(msg)
              File "C:\OSGeo4W\apps\Python39\lib\http\client.py", line 948, in send
              self.connect()
              File "C:\OSGeo4W\apps\Python39\lib\http\client.py", line 1422, in connect
              self.sock = self._context.wrap_socket(self.sock,
              File "C:\OSGeo4W\apps\Python39\lib\ssl.py", line 500, in wrap_socket
              return self.sslsocket_class._create(
              File "C:\OSGeo4W\apps\Python39\lib\ssl.py", line 1040, in _create
              self.do_handshake()
              File "C:\OSGeo4W\apps\Python39\lib\ssl.py", line 1309, in do_handshake
              self._sslobj.do_handshake()
             ssl.SSLError: A failure in the SSL library occurred (_ssl.c:1129)

             During handling of the above exception, another exception occurred:

             Traceback (most recent call last):
              File "C:\Users/andre/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgiscloud\qgiscloudplugindialog.py", line 414, in check_login
              raise e
              File "C:\Users/andre/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgiscloud\qgiscloudplugindialog.py", line 334, in check_login
              login_info = self.api.check_login(
              File "C:\Users/andre/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgiscloud\qgiscloudapi\qgiscloudapi.py", line 161, in check_login
              content = request.post(resource, data)
              File "C:\Users/andre/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgiscloud\qgiscloudapi\qgiscloudapi.py", line 596, in post
              return self.request(resource, method='POST', data=data)
              File "C:\Users/andre/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgiscloud\qgiscloudapi\qgiscloudapi.py", line 684, in request
              response = urllib.request.urlopen(req).read()
              File "C:\OSGeo4W\apps\Python39\lib\urllib\request.py", line 214, in urlopen
              return opener.open(url, data, timeout)
              File "C:\OSGeo4W\apps\Python39\lib\urllib\request.py", line 517, in open
              response = self._open(req, data)
              File "C:\OSGeo4W\apps\Python39\lib\urllib\request.py", line 534, in _open
              result = self._call_chain(self.handle_open, protocol, protocol +
              File "C:\OSGeo4W\apps\Python39\lib\urllib\request.py", line 494, in _call_chain
              result = func(*args)
              File "C:\OSGeo4W\apps\Python39\lib\urllib\request.py", line 1389, in https_open
              return self.do_open(http.client.HTTPSConnection, req,
              File "C:\OSGeo4W\apps\Python39\lib\urllib\request.py", line 1349, in do_open
              raise URLError(err)
             urllib.error.URLError: 

Initial SSL_CERT_FILE image Changing the cert didn't help: image

tpo commented 2 years ago

@aviborg - wow, thanks a lot for documenting - and thoroughly documenting - the workaround!!!

@mlbrack and @ralfWessels : are you able to get your setup working with @aviborg 's workaround?

Cc: @mhugent & @HusseinKabbout !!!

ralfWessels commented 2 years ago

Hi, when I worked on the 'normal' QGIS Desktop (Version 3.26 - no OSGeo4W) I had no more SSL Problems since a while - the last months... These are my environment variables image

tzehl commented 1 year ago

Hi, I am currently taking a refresher GIS course, and I am having the exact same issue with the QGIS Cloud plugin on my Windows 10 laptop, the error log looks exaclty like @mbrack and @avibor. I will copy it at the end of this message. I simply can't login to my QGIS cloud account, I have tried all of the suggested solution here but nothing solves the issue. The problem started out with my very reliable version of QGIS 3.22.12. I wanted to keep that version but I ended up wiping it out in the attempt to try and remediate the problem. I even erased the users'/user/appdata/roaming/qgis directory, and the one found on appdata/local. I mean, I searched for every little piece of software in my C drive that had qgis or osgeo (with osgeo I was careful becuase I alos have ArcGIS Pro) and erased it, reinstalled QGIS ltr AND QGIS 3.28 alternatively, both using the standalone installer and the OSGEO4W. I changed the environmental SSL_CERT_FILE and didn't change it. I went back and forth, did everything I could thnk of to try to get the QGIS Cloud Plugin to let me login and nothing! And I know my QGIS cloud account works because I borrowed my son's laptop, installed QGIS ltr and it worked the first time like a charmI I even compared his environmental variables with mine, the difference was that his variables included a Chocolatey install, which on his laptop was done by default and I even installed the chocolatey package manager on my laptop and again deinstalled and installed QGIS using the chocolatey but it still gives the exact same error, everytime I install the QGIS cloud plugin and try to login. I don't know what else to do.

My Environmental variables include one that is called Pythonpath, which is not included in my son's environmental variables. I am showing my current settings as I changed them in the screen shot, but it didn't work without changing them. Everything else works using the variables as they appear in the screen shot, i.e. postgres, pyqgis, etc are working. Everything but the QGIS cloud plugin works. variables And this is the error: An error has occurred while executing Python code:

urllib.error.URLError: Traceback (most recent call last): File "C:\PROGRA~1\QGIS 3.28.1\apps\Python39\lib\urllib\request.py", line 1346, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "C:\PROGRA~1\QGIS 3.28.1\apps\Python39\lib\http\client.py", line 1253, in request self._send_request(method, url, body, headers, encode_chunked) File "C:\PROGRA~1\QGIS 3.28.1\apps\Python39\lib\http\client.py", line 1299, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "C:\PROGRA~1\QGIS 3.28.1\apps\Python39\lib\http\client.py", line 1248, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "C:\PROGRA~1\QGIS 3.28.1\apps\Python39\lib\http\client.py", line 1008, in _send_output self.send(msg) File "C:\PROGRA~1\QGIS 3.28.1\apps\Python39\lib\http\client.py", line 948, in send self.connect() File "C:\PROGRA~1\QGIS 3.28.1\apps\Python39\lib\http\client.py", line 1422, in connect self.sock = self._context.wrap_socket(self.sock, File "C:\PROGRA~1\QGIS 3.28.1\apps\Python39\lib\ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "C:\PROGRA~1\QGIS 3.28.1\apps\Python39\lib\ssl.py", line 1040, in _create self.do_handshake() File "C:\PROGRA~1\QGIS 3.28.1\apps\Python39\lib\ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ssl.SSLError: A failure in the SSL library occurred (_ssl.c:1129)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users/tatyz/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgiscloud\qgiscloudplugindialog.py", line 456, in check_login raise e File "C:\Users/tatyz/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgiscloud\qgiscloudplugindialog.py", line 364, in check_login login_info = self.api.check_login( File "C:\Users/tatyz/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgiscloud\qgiscloudapi\qgiscloudapi.py", line 166, in check_login content = request.post(resource, data) File "C:\Users/tatyz/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgiscloud\qgiscloudapi\qgiscloudapi.py", line 570, in post return self.request(resource, method='POST', data=data) File "C:\Users/tatyz/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgiscloud\qgiscloudapi\qgiscloudapi.py", line 653, in request response = urllib.request.urlopen(req).read() File "C:\PROGRA~1\QGIS 3.28.1\apps\Python39\lib\urllib\request.py", line 214, in urlopen return opener.open(url, data, timeout) File "C:\PROGRA~1\QGIS 3.28.1\apps\Python39\lib\urllib\request.py", line 517, in open response = self._open(req, data) File "C:\PROGRA~1\QGIS 3.28.1\apps\Python39\lib\urllib\request.py", line 534, in _open result = self._call_chain(self.handle_open, protocol, protocol + File "C:\PROGRA~1\QGIS 3.28.1\apps\Python39\lib\urllib\request.py", line 494, in _call_chain result = func(*args) File "C:\PROGRA~1\QGIS 3.28.1\apps\Python39\lib\urllib\request.py", line 1389, in https_open return self.do_open(http.client.HTTPSConnection, req, File "C:\PROGRA~1\QGIS 3.28.1\apps\Python39\lib\urllib\request.py", line 1349, in do_open raise URLError(err) urllib.error.URLError:

tpo commented 1 year ago

Hi @tzehl,

[SSL Problem]

It seems like something with QGIS' (de)installation of openssl or certificates seems to be subtly broken somewhere.

So now you have one laptop where it works and one where it doesn't, which is "ideal" because we at Sourcepole have not been able to reproduce the problem yet.

I imagine there can be two things that could be going awry here:

  1. what (open)ssl library is QGIS using?
  2. what certificates is QGIS using?

I think either 1. or 2. is different between the two installations. So if you wan't to get to the root of the problem and fix it, then you "only" shoud need to compare those two things between the two installations.

On Linux you would strace the QGIS process and compare the two process traces. On Windows it seems there is a tool called "Process Monitor" (see https://stackoverflow.com/questions/3847745/systrace-for-windows) that seem to be able to achieve the same.

So could you please take "Process Monitor" and have a look at:

  1. which (open)ssl libraries QGIS is linking with or dynamically opening
  2. which certificates QGIS is reading

on both machines and compare the two and let us know about the results?

hdus commented 1 year ago

Seems to be a problem with the SSL-configuration on your system and could happen after an upgrade of QGIS 3.xx. The following steps helped to solve the SSL-problems in the almost cases:

  1. Please uninstall all QGIS installations with the regular Windows App uninstaller
  2. Remove all folder C:\Program Files\QGIS-XXXXX
  3. Remove all folder C:\Users[username]\AppData\Local\QGIS
  4. Remove all folder C:\Users[username]\AppData\LocalLow\QGIS
  5. Remove all folder C:\Users[username]\AppData\Roaming\QGIS

Now all QGIS stuff should be removed.

As the last step, please install QGIS 3.28 or higher again and let us know if it works now.

tzehl commented 1 year ago

Hello @tpo and @hdus, I thank you for your responses, I tried all that removed everything, cleaned up AppData/Local, LocalLow, and Roaming, but it still gave the same problem. I even reconfigured the entire laptop, I mean I seriously wiped out my C drive and re-installed all my programs and it still refused to work! However I am excited to report that I am now able to use QGIS Cloud on my very same laptop. What I ended up doing is, I created a brand new user, accessed QGIS from that other user and it works without any problems! Pretty annoying to have to go through so much reconfiguring before coming up with the simple solution of a brand new user.

hdus commented 1 year ago

@tzehl Thanks for the hint with the brand new Windows User.

MarlonSchwienbacher commented 1 year ago

Hallo, I am also having an SSL connection error when using the QGIS SCP plugin. I was trying many things to fix it (including to manualy set the SSL_CERT_FILE and reinstalling QGIS) but nothing worked so fare. Are there any further suggestions how to fix this problem? Thanks a lot!!

MarlonSchwienbacher commented 1 year ago

Seems to be a problem with the SSL-configuration on your system and could happen after an upgrade of QGIS 3.xx. The following steps helped to solve the SSL-problems in the almost cases:

  1. Please uninstall all QGIS installations with the regular Windows App uninstaller
  2. Remove all folder C:\Program Files\QGIS-XXXXX
  3. Remove all folder C:\Users[username]\AppData\Local\QGIS
  4. Remove all folder C:\Users[username]\AppData\LocalLow\QGIS
  5. Remove all folder C:\Users[username]\AppData\Roaming\QGIS

Now all QGIS stuff should be removed.

As the last step, please install QGIS 3.28 or higher again and let us know if it works now.

Hello, I did all these steps but it did not work (all my settings are gone so I really deleted everything in connection with QGIS). Do you have any other suggestions?

Thanks a lot! Marlon

tpo commented 1 year ago

Hallo, I am also having an SSL connection error when using the QGIS SCP plugin. I was trying many things to fix it (including to manualy set the SSL_CERT_FILE and reinstalling QGIS) but nothing worked so fare. Are there any further suggestions how to fix this problem? Thanks a lot!!

It would be useful to know what exactly the error is.

MarlonSchwienbacher commented 1 year ago

Hallo, I am also having an SSL connection error when using the QGIS SCP plugin. I was trying many things to fix it (including to manualy set the SSL_CERT_FILE and reinstalling QGIS) but nothing worked so fare. Are there any further suggestions how to fix this problem? Thanks a lot!!

It would be useful to know what exactly the error is.

Hallo tpo,

The exact error on the QGIS window under Version 3.32 when trying to load Sentinel 2 Data with the SCP plugin is: "Error [56]: SSL connection error. Please see the FAQ of the plugin user manual for solving this" and within the SCP Plugin I get the error: " ERROR exception: <urlopen error A failure in the SSL library occurred (_ssl.c:1129)>" when runing a test I get a "SNAP subprocess: Fail"

Thank you very much!

MarlonSchwienbacher commented 1 year ago

Hi @tzehl,

[SSL Problem]

It seems like something with QGIS' (de)installation of openssl or certificates seems to be subtly broken somewhere.

So now you have one laptop where it works and one where it doesn't, which is "ideal" because we at Sourcepole have not been able to reproduce the problem yet.

I imagine there can be two things that could be going awry here:

  1. what (open)ssl library is QGIS using?
  2. what certificates is QGIS using?

I think either 1. or 2. is different between the two installations. So if you wan't to get to the root of the problem and fix it, then you "only" shoud need to compare those two things between the two installations.

On Linux you would strace the QGIS process and compare the two process traces. On Windows it seems there is a tool called "Process Monitor" (see https://stackoverflow.com/questions/3847745/systrace-for-windows) that seem to be able to achieve the same.

So could you please take "Process Monitor" and have a look at:

  1. which (open)ssl libraries QGIS is linking with or dynamically opening
  2. which certificates QGIS is reading

on both machines and compare the two and let us know about the results?

@tpo, I just checked the Environments and the SSL_CERT_DIR stated in QGIS actually does not exist on my computer, can this maybe be the cause of the error?

SSL_CERT_DIR SSL_CERT_DIR_2
tpo commented 1 year ago

@MarlonSchwienbacher - could you search in your explorer a directory named "openssl". Where is it?

MarlonSchwienbacher commented 1 year ago

@MarlonSchwienbacher - could you search in your explorer a directory named "openssl". Where is it?

@tpo the openssl directory is in within the Qt5/certs directory. I also tried to set it as "SSL_CERT_DIR" but that didnt work, do I may have to move it to the qgis directory? Or do something else with it?

openssl
jmgl0003 commented 10 months ago

La única solución que me ha funcionado es desactivar el ssl en el request. image

HusseinKabbout commented 10 months ago

La única solución que me ha funcionado es desactivar el ssl en el request. image

That is not really an option, since this disables the security altogether.

ARTCON2020 commented 7 months ago

Hi, I tried to publish my map(layer) on the WEB based on the QGIS Cloud plugin describition. I am loged in by using my user name and password. However I could not go further because of this erorr message. I read all your feedbacks above and applied for my case but it didn't work.

An error has occurred while executing Python code:

AttributeError: 'NoneType' object has no attribute 'cursor' Traceback (most recent call last): File "C:\Users/tasaz0604/AppData/Roaming/QGIS/QGIS3\profiles\Tassew/python/plugins\qgiscloud\qgiscloudplugindialog.py", line 427, in check_login self.refresh_databases() File "C:\Users/tasaz0604/AppData/Roaming/QGIS/QGIS3\profiles\Tassew/python/plugins\qgiscloud\qgiscloudplugindialog.py", line 653, in refresh_databases db_size = self.db_size_name(name) File "C:\Users/tasaz0604/AppData/Roaming/QGIS/QGIS3\profiles\Tassew/python/plugins\qgiscloud\qgiscloudplugindialog.py", line 1539, in db_size_name cursor = conn.cursor() AttributeError: 'NoneType' object has no attribute 'cursor'

Python version: 3.9.18 (heads/master:5eba59e, Feb 1 2024, 20:02:10) [MSC v.1929 64 bit (AMD64)] QGIS version: 3.34.5-Prizren Prizren, 4b308492

Python Path: C:/PROGRA~1/QGIS33~1.5/apps/qgis-ltr/./python C:/Users/tasaz0604/AppData/Roaming/QGIS/QGIS3\profiles\Tassew/python C:/Users/tasaz0604/AppData/Roaming/QGIS/QGIS3\profiles\Tassew/python/plugins C:/PROGRA~1/QGIS33~1.5/apps/qgis-ltr/./python/plugins C:\PROGRA~1\QGIS33~1.5\apps\grass\grass83\etc\python C:\Users\tasaz0604\Documents C:\Program Files\QGIS 3.34.5\bin\python39.zip C:\PROGRA~1\QGIS33~1.5\apps\Python39\DLLs C:\PROGRA~1\QGIS33~1.5\apps\Python39\lib C:\Program Files\QGIS 3.34.5\bin C:\PROGRA~1\QGIS33~1.5\apps\Python39 C:\PROGRA~1\QGIS33~1.5\apps\Python39\lib\site-packages C:\PROGRA~1\QGIS33~1.5\apps\Python39\lib\site-packages\win32 C:\PROGRA~1\QGIS33~1.5\apps\Python39\lib\site-packages\win32\lib C:\PROGRA~1\QGIS33~1.5\apps\Python39\lib\site-packages\Pythonwin C:/Users/tasaz0604/AppData/Roaming/QGIS/QGIS3\profiles\Tassew/python