SAML SP for Java reports Connection refused during logout

Problem

SAML SP fails during logout with the following error:

com.ubisecure.saml2.sp.ServiceProviderException: INTERNAL_ERROR: com.ubisecure.saml2.core.SAMLException: java.net.ConnectException: Connection refused: connect 

Solution

This error indicates that SP tries to do a back channel logout using the SOAP SingleLogoutEndpoint described in the IDP Metadata of Ubisecure SSO, but the server does not respond. This is usually due to a firewall which blocks the traffic between SP and IDP.