MiNiFi unable to connect to NiFi

Issue

MiNiFi unable to connect to NiFi server with this error message:

ERROR [Site-to-Site Worker Thread-0] o.a.nifi.remote.SocketRemoteSiteListener Unable to communicate with remote instance null due to org.apache.nifi.remote.exception.HandshakeException: Handshake with nifi://minifi.example.com:60408 failed because the Magic Header was not present; closing connection

Caused

MiNiFi agent is configured with SSL while NiFi Server is in plain http

Resolution

Use all endpoint in "all http" or "all https". Do not mix both.