-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mosquitto_sub can't connect to IPv6 only hosts via TLS #376
Comments
I narrowed it down to lib/net_mosq.c#L284-L288 which was introduced in 041f60c: #ifdef WITH_TLS
if(mosq->tls_cafile || mosq->tls_capath || mosq->tls_psk){
hints.ai_family = PF_INET;
}else
#endif
{
hints.ai_family = PF_UNSPEC;
} If I remove the conditional and always set |
Hi @Tho85, this is down to support for IPv6 being historically lacking in openssl. This has already been fixed in the fixes branch which should be released as version 1.4.11 real soon now. |
This is the same code as in #323, although the subject is different. I'm hence marking this as a duplicate and closing it. Thanks for the good report anyway! |
mosquitto_sub can't connect to IPv6 only hosts via TLS.
Steps to reproduce
test.mosquitto.org
:Expected behavior
The client should connect and I should see a test message (e.g. "
Hello world!
").Actual behavior
The client doesn't connect. An error occurs:
Unable to connect (Lookup error.).
Further information
A wireshark dump shows that
mosquitto_sub
tries to resolve an IPv4 address fortest6.mosquitto.org
if called with the--cafile
option, and both an IPv4 and an IPv6 address if called without--cafile
:Environment
The text was updated successfully, but these errors were encountered: