Skip to content

The client connects to server without validating server certificate #226

Closed
@harrydevnull

Description

@harrydevnull

Backdrop : we have been using the amqp-rabbit connectionfactory. we use self signed certificate on server. we don't do the client-server authentication using TLS.

If the truststore and keystore is null and Usessl flag is set to true; the client accepts connections from any server.
below code gets invoked in the above scenario

  useSslProtocol(protocol, new NullTrustManager());

and in NullTrustManager as the doc suggest we do nothing.

/* Doesn't even bother looking at its arguments, simply returns,
/* which makes the check succeed.
*/

this is a grave security flaw (I feel) . This opens up possibility of man-in-middle attack.
If truststore is null we should delegate to Java's default implementation; under $JAVA_HOME/jre/lib/security/caccerts

I had updated code in my fork to reflect whatever I said.
do you agree or is there something else which i may have overlooked?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions