{"record":{"id":"d52409e9e7935153","repo":"fluent/fluentd","slug":"bug-failed-to-verify-certification-and-to-handle","errorCode":null,"errorMessage":"BUG: failed to verify certification and to handle it correctly while connecting host #{host} as #{fqdn}","messagePattern":"BUG: failed to verify certification and to handle it correctly while connecting host #(.+?) as #(.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"lib/fluent/plugin_helper/socket.rb","lineNumber":188,"sourceCode":"            Timeout.timeout(connect_timeout) { sock.connect }\n          rescue Timeout::Error\n            log.warn \"timeout while connecting tls session\", host: host\n            sock.close rescue nil\n            raise\n          end\n        else\n          sock.connect\n        end\n\n        begin\n          if verify_fqdn\n            log.trace \"checking peer's certificate\", subject: sock.peer_cert.subject\n            sock.post_connection_check(fqdn)\n            verify = sock.verify_result\n            if verify != OpenSSL::X509::V_OK\n              err_name = Socket.tls_verify_result_name(verify)\n              log.warn \"BUG: failed to verify certification while connecting (but not raised, why?)\", host: host, fqdn: fqdn, error: err_name\n              raise RuntimeError, \"BUG: failed to verify certification and to handle it correctly while connecting host #{host} as #{fqdn}\"\n            end\n          end\n        rescue OpenSSL::SSL::SSLError => e\n          log.warn \"failed to verify certification while connecting tls session\", host: host, fqdn: fqdn, error: e\n          raise\n        end\n\n        if block\n          begin\n            block.call(sock)\n          ensure\n            sock.close rescue nil\n          end\n        else\n          sock\n        end\n      end\n","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/fluent/fluentd/blob/dd45c6e18dc7be33b5e5a0f0767bf46307ff5626/lib/fluent/plugin_helper/socket.rb#L170-L206","documentation":"Error \"BUG: failed to verify certification and to handle it correctly while connecting host #{host} as #{fqdn}\" thrown in fluent/fluentd.","triggerScenarios":"Thrown at lib/fluent/plugin_helper/socket.rb:188 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"dd45c6e18dc7be33b5e5a0f0767bf46307ff5626","analyzedAt":"2026-08-21T16:22:07.332Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}