Disable MQTT server certificate check

I'm trying to configure MQTT to connect to my local server, with SSl but without the need to check the server certificate. I'm getting the following exception:

MqttException (0) - javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Is there a way to disable server certificate check?