Add tls: prefix to docs and samples

This commit is contained in:
Ian Craggs 2025-08-15 15:55:00 +01:00
parent 3a076d7d33
commit b289797aca
No known key found for this signature in database
GPG Key ID: A7AE1A8F2CCAB186
6 changed files with 16 additions and 8 deletions

View File

@ -177,11 +177,11 @@
/**
* Return code: protocol prefix in serverURI should be:
* @li @em tcp:// or @em mqtt:// - Insecure TCP
* @li @em ssl:// or @em mqtts:// - Encrypted SSL/TLS
* @li @em ssl:// or @em tls:// or @em mqtts:// - Encrypted SSL/TLS
* @li @em ws:// - Insecure websockets
* @li @em wss:// - Secure web sockets
*
* The TLS enabled prefixes (ssl, mqtts, wss) are only valid if the TLS
* The TLS enabled prefixes (ssl, tls, mqtts, wss) are only valid if the TLS
* version of the library is linked with.
*/
#define MQTTASYNC_BAD_PROTOCOL -14

View File

@ -186,10 +186,10 @@
/**
* Return code: protocol prefix in serverURI should be:
* @li @em tcp:// or @em mqtt:// - Insecure TCP
* @li @em ssl:// or @em mqtts:// - Encrypted SSL/TLS
* @li @em ssl:// or @em tls:// or @em mqtts:// - Encrypted SSL/TLS
* @li @em ws:// - Insecure websockets
* @li @em wss:// - Secure web sockets
* The TLS enabled prefixes (ssl, mqtts, wss) are only valid if a TLS
* The TLS enabled prefixes (ssl, tls, mqtts, wss) are only valid if a TLS
* version of the library is linked with.
*/
#define MQTTCLIENT_BAD_PROTOCOL -14

View File

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2012, 2020 IBM Corp., and others
* Copyright (c) 2012, 2025 IBM Corp., Ian Craggs and others
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
@ -314,6 +314,8 @@ void myconnect(MQTTAsync client)
}
if (opts.connection && (strncmp(opts.connection, "ssl://", 6) == 0 ||
strncmp(opts.connection, "tls://", 6) == 0 ||
strncmp(opts.connection, "mqtts://", 7) == 0 ||
strncmp(opts.connection, "wss://", 6) == 0))
{
if (opts.insecure)

View File

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2012, 2020 IBM Corp., and others
* Copyright (c) 2012, 2025 IBM Corp., Ian Craggs and others
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
@ -303,6 +303,8 @@ int main(int argc, char** argv)
}
if (opts.connection && (strncmp(opts.connection, "ssl://", 6) == 0 ||
strncmp(opts.connection, "tls://", 6) == 0||
strncmp(opts.connection, "mqtts://", 7) == 0 ||
strncmp(opts.connection, "wss://", 6) == 0))
{
ssl_opts.verify = (opts.insecure) ? 0 : 1;

View File

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2012, 2022 IBM Corp.
* Copyright (c) 2012, 2025 IBM Corp., Ian Craggs
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
@ -85,6 +85,8 @@ int myconnect(MQTTClient client)
}
if (opts.connection && (strncmp(opts.connection, "ssl://", 6) == 0 ||
strncmp(opts.connection, "tls://", 6) == 0 ||
strncmp(opts.connection, "mqtts://", 7) == 0 ||
strncmp(opts.connection, "wss://", 6) == 0))
{
if (opts.insecure)

View File

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2012, 2022 IBM Corp., and others
* Copyright (c) 2012, 2025 IBM Corp., Ian Craggs and others
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
@ -82,6 +82,8 @@ int myconnect(MQTTClient client)
}
if (opts.connection && (strncmp(opts.connection, "ssl://", 6) == 0 ||
strncmp(opts.connection, "tls://", 6) == 0 ||
strncmp(opts.connection, "mqtts://", 7) == 0 ||
strncmp(opts.connection, "wss://", 6) == 0))
{
if (opts.insecure)