A question about the security of the XMPP server

Hello,

Does the XMPP server check the validity of the certificate during S2S connections?
For example, do you reject connections to servers that use self-signed certificates? Or do you allow it?