--insecure disables checking if the hostname in the certificate matches. Based on the man page, it seems like it still checks if a valid certificate trusted by the given CA is used.
I don't know from which crate SslOptions originates, but the name enable_server_cert_auth seems to suggest it also disables verifying that the certificate is trusted by the given CA.
I created self signed certificate by openssl but I put the host name there.
However it is still not connecting when its enable_server_cert_auth(true), but when its false everything is fine & working.
to find what's wrong with the certificate it uses, and fix the HTTPS connection, instead of disabling security entirely.
Disabling anything about the verification is always insecure, and allows MITM attacks.
There's no difference between allowing wrong hostname from a correct CA or allowing any invalid certificate. Valid CA-signed domain certificates can be obtained automatically for free by anybody, so the hostname check is the crucial thing required for security.