How to disable TLS Verification on Java SDK 3?

Hi everyone,

I just want to make our client trust what ever certificates from the server. In the documentary at https://docs.couchbase.com/java-sdk/current/howtos/managing-connections.html
it’s written:
" If you are running on localhost and just want to enable TLS for a development machine, just copying and pasting it suffices — so long as you use 127.0.0.1 rather than localhost in the connection string . This is because the certificate will not match the name localhost . Setting TLSSkipVerify is a workaround if you need to use couchbases://localhost."

I coundn’t find option TLSKipVerify in Java SDK 3.1, has this option been removed or replaced? If so, how do we bypass TLS verification?

If you want to just skip hostname verification, on the SecurityConfig you can set enableHostnameVerification to false. If you want to trust ALL certificates, Use .trustManagerFactory(InsecureTrustManagerFactory.INSTANCE).

Thank your your quick reply