Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mosquitto-dev] IPv6 + TLS support?

Hi,

Does the Mosquitto library support IPv6 + TLS? From reading the code, it looks like the library is hard-coded to use IPv4 when WITH_TLS is defined.

See _mosquitto_try_connect in net_mosq.c:

memset(&hints, 0sizeof(struct addrinfo));

#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;

}


We are writing an iOS app that talks to an IoT device over MQTT. When our app is connected to an NAT64-based network, it is unable to connect to our device over the Internet. The app connects fine if we set hints.aifamily to PFINET6 or PF_UNSPEC though. 

Is IPv4-only support intentional? Would we run into side effects if we permanently set hints.aifamily to PF_UNSPEC?

Thanks!

Aaron


Aaron Tunney

Senior Software Engineer (iOS)

Direct: +44 207 780 4776

aaron.tunney@xxxxxxxx   |   http://www.akqa.com

AKQA, 1 St John's Lane, London EC1M 4BL, UK
Registered in England: 2964394

Confidentiality notice:
The information transmitted in this email and/or any attached document(s) is confidential and intended only for the person or entity to which it is addressed and may contain privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.

Back to the top