【问题标题】:How to send syslog without TLS with python and sysloghandler?如何使用 python 和 sysloghandler 在没有 TLS 的情况下发送 syslog?
【发布时间】:2021-08-28 07:01:00
【问题描述】:

我想发送不带 TLS 的系统日志。 我正在使用自定义 python 工具通过 TCP 记录系统日志,到目前为止,它可以工作。 但我需要发送没有 TLS 的系统日志。

我正在使用带有选项 socket.SOCK_STREAM 的 pyhton SysLogHandler 方法,但没有限制 TLS 部分的选项。

我阅读了有关 SysLogHandler 的文档,但无论如何我都没有看到停用 TLS。 有没有办法在没有 TLS 的情况下发送 TCP 系统日志?

谢谢你。

【问题讨论】:

    标签: python ssl syslog


    【解决方案1】:

    我在standard library's logging.handlers.SysLogHandler 实现中看不到有关 TLS 的任何信息。 (下一个处理程序,用于 SMTP,确实谈到了 TLS。)

    所以我想只是

    handler = SysLogHandler(('some-host', 12345), socktype=socket.SOCK_STREAM)
    

    应该通过 TCP 将 syslog 消息通过管道传送到 some-host:12345。

    【讨论】:

      猜你喜欢
      • 2015-07-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-15
      • 2011-06-22
      • 2018-09-24
      • 1970-01-01
      • 2017-09-15
      相关资源
      最近更新 更多