-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Many Log4j components have a configuration attribute to enable the verification of the TLS server certificate:
-
Network appenders (
Socket,SMTP) use theverifyHostnameattribute of theSSLnested component to provide the same feature. Its default value isfalse. -
The HTTP Appender has a configuration attribute
verifyHostname. The value defaults totrue. Note that the HTTP Appender can also have a nestedSSLcomponent, but the value ofSSL.verifyHostnameis ignored. -
We also have a
log4j2.sslVerifyHostNameconfiguration property that is used if theSSLcomponent is absent.
I understand that in the past only HTTP servers had a X509 certificate issued by a public CA. However nowadays most SMTP servers have also publicly verifiable X509 certificates, so we can switch both defaults to true.
Besides that a public X509 certificate was never required by our appenders: they only connect to a single host.
Proposed changes
- Let us deprecate
HTTP.verifyHostnamein2.x. In3.xwe can still keep it, but set its default value toSSL.verifyHostname. - We can switch the default value of
SSL.verifyHostnametotrue. This might require some additional work: the SMTP and HTTP appenders only connect to the host, when there is a log event to send. In the case of SMTP this happens only forERRORlog events by default, so users might realize that they have a configuration problem much later. - Currently if the user configures an
SSLelement, all thelog4j2.ssl*configuration properties are ignored. I think those properties should still be used to provide default values forSSL.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status