influxdata/telegraf

tls: failed to parse certificate from server: x509: negative serial number

Eraser3 opened this issue · 0 comments

Relevant telegraf.conf

[[inputs.sqlserver]]
  servers = [
    "Server=127.0.0.1;Port=1433;User Id=telegraf;Password=<HIDDEN>;Database=<MyDatabase>;app name=telegraf;log=1;TrustServerCertificate=1;",
  ]

  query_timeout = "10s"
  database_type = "SQLServer"
  include_query = ["SQLServerPerformanceCounters", "SQLServerRequests"]
  exclude_query = ["SQLServerAvailabilityReplicaStates", "SQLServerDatabaseReplicaStates"]

Logs from Telegraf

Dec 15 14:18:30 sql-02 telegraf[11607]: 2024-12-15T13:18:30Z E! [inputs.sqlserver] Error in plugin: query SQLServerRequests failed for server: 127.0.0.1 and database: <MyDatabase> with Error: TLS Handshake failed: tls: failed to parse certificate from server: x509: negative serial number
Dec 15 14:18:30 sql-02 telegraf[11607]: 2024-12-15T13:18:30Z E! [inputs.sqlserver] Error in plugin: query SQLServerPerformanceCounters failed for server: 127.0.0.1 and database: <MyDatabase> with Error: TLS Handshake failed: tls: failed to parse certificate from server: x509: negative serial number

System info

Telegraf 1.33.0, Ubuntu 20.04.6 LTS, Microsoft SQL Server 2019 (RTM-CU30) (KB5049235) - 15.0.4415.2 (X64) Standard Edition (64-bit)

Docker

No response

Steps to reproduce

  1. Install SQL Server 2019
  2. Configure Telegraf sqlserver input
  3. Run Telegraf

Expected behavior

Telegraf to successfully connect with SQL Server.

Actual behavior

Telegraf fails the SQL Server TLS handshake because of the X509 negative serial number.

Additional info

No response