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

Unable to use TLS - Advanced TLS options errors when trying to set (save) and/or get (when OctoPrint starts) #119

Open
ernestgwilsonii opened this issue May 1, 2022 · 0 comments

Comments

@ernestgwilsonii
Copy link

ernestgwilsonii commented May 1, 2022

What were you doing?

Cannot get this plugin to use TLS with MQTT.
Unable to use TLS - Advanced TLS options errors when trying to set (save) and/or get (when OctoPrint starts).
Note: Using this plugin without TLS, it works just fine with MQTT.
The issue occurs only when attempting to use TLS and as a result unable to use TLS.

What did you expect to happen?

1. Expected Advanced TLS options to be able to be set without getting an error in the log.
2. Expected the plugin to be able to use Advanced TLS options when OctoPrint starts and not get an error in the log.

What happened instead?

A. Error when trying to save Advanced TLS options:

2022-05-01 11:13:34,400 - octoprint.plugins.mqtt - INFO - Settings changed (broker_diff={'tls': {'certfile': '/home/pi/certs/mqtt/octopi.crt', 'keyfile': '/home/pi/certs/mqtt/octopi.key'}}, lw_diff={}), reconnecting to broker
2022-05-01 11:13:35,419 - octoprint.server.api.settings - ERROR - Could not save settings for plugin MQTT (0.8.12)
Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/server/api/settings.py", line 1114, in _saveSettings
    plugin.on_settings_save(data["plugins"][plugin_id])
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/__init__.py", line 1737, in wrapper
    return f(*args, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_mqtt/__init__.py", line 162, in on_settings_save
    self.mqtt_connect()
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_mqtt/__init__.py", line 311, in mqtt_connect
    self._mqtt.tls_set(**tls_args)
  File "/home/pi/oprint/lib/python3.7/site-packages/paho/mqtt/client.py", line 809, in tls_set
    context.set_ciphers(ciphers)
ssl.SSLError: ('No cipher can be selected.',)

B. Error when OctoPrint starts:

2022-05-01 11:27:50,366 - octoprint.plugin - ERROR - Error while calling plugin mqtt
Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/plugin/__init__.py", line 271, in call_plugin
    result = getattr(plugin, method)(*args, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/__init__.py", line 1737, in wrapper
    return f(*args, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_mqtt/__init__.py", line 83, in on_startup
    self.mqtt_connect()
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_mqtt/__init__.py", line 311, in mqtt_connect
    self._mqtt.tls_set(**tls_args)
  File "/home/pi/oprint/lib/python3.7/site-packages/paho/mqtt/client.py", line 809, in tls_set
    context.set_ciphers(ciphers)
ssl.SSLError: ('No cipher can be selected.',)

Version of OctoPrint

OctoPrint 1.7.3 Python 3.7.3 OctoPi 0.18.0

Version of the MQTT plugin

MQTT (0.8.12) = /home/pi/oprint/lib/python3.7/site-packages/octoprint_mqtt

Used MQTT broker and its version

mosquitto version 2.0.13

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

1 participant