Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traceback error when attempting to download data from the China global broker #41

Open
RoryPTB opened this issue Oct 13, 2023 · 1 comment

Comments

@RoryPTB
Copy link

RoryPTB commented Oct 13, 2023

When I attempt to subscribe to the data from gb.wis.cma.cn, I get the following traceback error:

$ pywis-pubsub subscribe --config china-config.yml --verbosity DEBUG
DEBUG:pywis_pubsub.mqtt:Connecting to broker mqtts://gb.wis.cma.cn:8883 with id pywis-pubsub-377
DEBUG:pywis_pubsub.mqtt:Setting credentials
DEBUG:pywis_pubsub.mqtt:Setting TLS version 2
Traceback (most recent call last):
  File "C:\Users\rptb2\Code\WMO\PubSub\pywis-pubsub\Scripts\pywis-pubsub-script.py", line 33, in <module>
    sys.exit(load_entry_point('pywis-pubsub==0.6.dev0', 'console_scripts', 'pywis-pubsub')())
  File "C:\Users\rptb2\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\rptb2\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "C:\Users\rptb2\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\rptb2\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\rptb2\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "C:\Users\rptb2\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "C:\Users\rptb2\Code\WMO\PubSub\pywis-pubsub\lib\site-packages\pywis_pubsub-0.6.dev0-py3.10.egg\pywis_pubsub\subscribe.py", line 206, in subscribe
  File "C:\Users\rptb2\Code\WMO\PubSub\pywis-pubsub\lib\site-packages\pywis_pubsub-0.6.dev0-py3.10.egg\pywis_pubsub\mqtt.py", line 79, in __init__
  File "C:\Users\rptb2\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\paho\mqtt\client.py", line 914, in connect
    return self.reconnect()
  File "C:\Users\rptb2\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\paho\mqtt\client.py", line 1073, in reconnect
    sock.do_handshake()
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\ssl.py", line 1342, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1007)

I can confirm this occurs when I am connected to the China global broker using MQTT Explorer. Here is the config file I used as a txt file (as GitHub does not support the yml extension).

@tomkralidis
Copy link
Collaborator

@RoryPTB can you set verify_certs: False in your config? This should skip certificate validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants