Skip to content

Keep a host set to SSL on SSL when its TLS connection fails - #136

Merged
somethingwithproof merged 1 commit into
developfrom
fix/mikrotik-ssl-no-downgrade
Nov 19, 2026
Merged

somethingwithproof merged 1 commit into
developfrom
fix/mikrotik-ssl-no-downgrade

Conversation

@somethingwithproof

Copy link
Copy Markdown
Member

Description

Follow-up to #133. When the api-ssl connection to a host set to SSL fails, mikrotik_api_open() retried on the plaintext api port (8728) and, if that login worked, cleared the stored ssl setting. One failed TLS connection, whether the device changed or a handshake was interrupted, was enough to send the credentials in cleartext and keep the host on cleartext for every later poll.

The poller now logs one specific error and skips the device. The stored setting is changed only from the host edit form, which already preserves a saved on value when api-ssl is unreachable. This removes the downgrade block, including the `ssl` quoting and single-attempt refinements added in #133.

Related Issue

#133

How Has This Been Tested?

  • tests/Security/SslTransportPolicyTest.php (new) checks that mikrotik_api_open() makes a single connect() call and never updates plugin_mikrotik_credentials. It fails on develop and passes here.
  • Full plugin suite: 123 passed (PHP 8.5, Cacti harness). php -l clean; php-cs-fixer reports no new changes compared with develop.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

The poller retried a failed api-ssl connection on the plaintext api
port and, when that login worked, cleared the stored SSL setting.  One
failed TLS connection was enough to move the device to cleartext for
every later poll.  Log a specific error and skip the device instead;
only the host edit form changes the setting.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
@sonarqubecloud

Copy link
Copy Markdown

@somethingwithproof
somethingwithproof merged commit 0591637 into develop Nov 19, 2026
7 checks passed
@somethingwithproof
somethingwithproof deleted the fix/mikrotik-ssl-no-downgrade branch November 19, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants