首页 > 解决方案 > 配置 log4j' HTTP appender 以接受自签名证书

问题描述

我正在尝试使用 Log4J 的 HTTP Appender 将日志发送到 Splunk Cloud 的 HTTP 事件收集器。但是,Splunk 似乎在其 HTTP 事件收集器上使用了自签名证书,因此当 Log4J 尝试连接到它时会导致 SSL 验证错误:

ERROR Unable to send HTTP in appender [Splunk] javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

如何暂时禁用 HTTP Appender 的 SSL 证书验证(类似于 CURL 的 -k 选项)?

标签: javalogginglog4jsplunk

解决方案


推荐阅读