Skip to content

MongoDB input does not report TLS certificate errors #4064

@danielnelson

Description

@danielnelson

Bug report

Relevant telegraf.conf:

[[inputs.mongodb]]
  servers = ["$MONGODB_URL"]
  gather_perdb_stats = false
  ## Optional SSL Config
  ssl_ca = "/ssl/mongodb/ca.pem"
  ssl_cert = "/ssl/mongodb/cert.pem"
  ssl_key = "/ssl/mongodb/key.pem"
  insecure_skip_verify = true

System info:

1.6.0

Steps to reproduce:

  1. Provide certificate that cannot be loaded
  2. telegraf --input-filter mongodb --test

Expected behavior:

Error indicating the certificate could to be loaded.

Actual behavior:

Falls back to non-TLS connection

E! Error in plugin [inputs.mongodb]: Unable to connect to MongoDB, no reachable servers

Additional info:

MongoDB server says:

I -        [conn380] AssertionException handling request, closing client connection: 17189 The server is configured to only allow SSL connections

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugunexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions