I can’t help you on this particular error, but if you don’t need the hostname check you should be able to disable it by passing verify_none as an ssl option.
That would not be the way to disable the hostname check, that disables the whole certifcate path validation and this is probably not what you want. You can disable the host name check by providing the {server_name_indication, disable} as a client option.
The host name check is not part of the TLS protocol, it is an additional check that has become sort of mandatory for at least HTTPS clients. It checks that the hostname given in the URI does match some value in the certificate. If this is important to your use case or not I cannot say.
Also the hostname check is customizable, look at the documentation for details.