Commit Graph

164 Commits (a1a190b4828b3678c2a75d7d55926e8c3351ccba)

Author SHA1 Message Date
Roger A. Light a1a190b482 Pointless whitespace tidy. 4 years ago
Roger A. Light d09591d92e Fix reconnecting in some cases when using MOSQ_OPT_TLS_USE_OS_CERTS.
Fix reconnecting failing when MOSQ_OPT_TLS_USE_OS_CERTS was in use, but none
of capath, cafile, psk, nor MOSQ_OPT_SSL_CTX were set, and
MOSQ_OPT_SSL_CTX_WITH_DEFAULTS was set to the default value of true.

Closes #2288. Thanks to Poltorak Serguei.
4 years ago
Roger A. Light 376226c129 Build warning fixes. 4 years ago
Roger A. Light ea371564e7 Disable TLS 1.3 when using TLS-PSK, because it isn't correctly config'd. 4 years ago
Roger A. Light a37c8e65d2 TLS-PSK mismatch fix.
Produce an error if a TLS-PSK client tries to connect to a broker
that is not configured with TLS-PSK.
4 years ago
Roger A. Light 79542158f4 Fix `max_connections` option not being correctly counted. 4 years ago
Roger A. Light 403691ce40 Add missing return types. 4 years ago
Roger A. Light 625e2a5060 Refactor to remove duplicate code. 4 years ago
Roger Light 6ebbb4d654 Fix possible socket leak.
This would occur if a client was using `mosquitto_loop_start()`, then if
the connection failed due to the remote server being inaccessible they
called `mosquitto_loop_stop(, true)` and recreated the mosquitto object.

See: https://www.eclipse.org/forums/index.php?t=rview&goto=1839865#msg_1839865
5 years ago
Roger A. Light 6e3738dcf0 Fix bridges not always connecting on Windows.
Closes #2043. Thanks to ttsorensen.
5 years ago
Roger A. Light a4389fc9ce Fix SPDX identifiers: EDL-1.0 -> BSD-3-Clause.
The two licenses are the same.
5 years ago
Roger A. Light 370cec5edd Fixes for lots of minor build warnings highlighted by Visual Studio. 5 years ago
Roger Light c604cf8fd0 net__write buf should be const. 5 years ago
Roger A. Light d8dcfd75fe lib: Fix DH group not being set for TLS connections.
This meant ciphers using DHE couldn't be used.

Closes #1925. Closes #1476. Thanks to Jonathan Sönnerup, Valerii
Demeshko, and sectokia.
5 years ago
Nikolay Raspopov 71845d28ac
Fixed some VS2017 compilation error and warnings (#1916)
* Fixed some VS2017 compilation errors and warnings.

Signed-off-by: raspopov <raspopov@cherubicsoft.com>
5 years ago
Roger A. Light 3731535298 Add SPDX license identifiers. 5 years ago
Roger A. Light b34dcd2a67 Final remove support for legacy libwebsockets
This means libwebsockets < 2.4.0.
5 years ago
Roger A. Light 29c771cdd4 Add lib and client support for OS CA certs
- Add `MOSQ_OPT_TLS_USE_OS_CERTS` option, to instruct the client to load and  trust OS provided CA certificates for use with TLS connections.
- All clients now load OS provided CA certificates if used with `-L
  mqtts://...`, or if port is set to 8883 and no other CA certificates are
  used. Closes #1824.
- Add the `--tls-use-os-certs` option to all clients.

Closes #1824. Thanks to Jens Reimann.
5 years ago
Roger A. Light 584cf51ba7 Update to EPL-2.0 5 years ago
Roger A. Light 4e3b8ed2b5 Fix cherry picked commit. 5 years ago
Roger A. Light 10ecae6275 Fix bridge sock not being removed from sock hash on error
Prior to this, duplicate entries could be added to the sock hash, which caused an infinite loop. Only affects bridges with bad settings on startup, and only when compiled using WITH_ADNS=yes.

Closes #1897. Thanks to Rodolfo Ochoa.
5 years ago
Roger A. Light b816d46508 Use db as a global var instead of passing to functions.
This allows a big swath of ifdefs to be removed. It also means savings as the db var is not passed around all of the time, and makes it easier to remove the final broker call to mosquitto_time() call in packet_mosq.c. In one test this reduced the calls to mosquitto_time() from 295k to 48k.
5 years ago
Roger A. Light abbeb4494f Change `tls_version` option behaviour.
The `tls_version` option now defines the *minimum* TLS protocol version to
be used, rather than the exact version.

Closes #1258. Thanks to Daniele Sluijters.
5 years ago
Roger A. Light 4f61f6c161 Fix conversion errors. 5 years ago
Roger A. Light c90e49af1b Merge remote-tracking branch 'origin/fixes' into develop 5 years ago
Roger A. Light 56ba1b99db Add `mosquitto_ssl_get()`.
This allow clients to access their SSL structure and
perform additional verification.
5 years ago
Roger A. Light f180e923ef Merge branch 'lazy_ssl' of git://github.com/abiliojr/mosquitto into abiliojr-lazy_ssl 5 years ago
Roger A. Light 9b5112f547 Fix unsigned compared against 0.
Coverity Scan 1431132.
5 years ago
Abilio Marques d5aae3eca7 lazy init SSL
Signed-off-by: Abilio Marques <abiliojr@gmail.com>
5 years ago
Roger A. Light 762ad432e8 Fix support for openssl 3.0 5 years ago
Roger A. Light 5cf94d2e57 Merge branch 'fixes' of git://github.com/ChristianS99/mosquitto into fixes 6 years ago
Roger A. Light c84d175b3d Fixes for the poor souls stuck on <c99.
Closes #1622.
6 years ago
Roger A. Light d96543c0b8 Merge branch 'fixes' into develop 6 years ago
Roger A. Light b0a065f790 Update changelog. Release page. Bump copyright. 6 years ago
Roger A. Light 3a89059271 Don't call SSL_shutdown() if SSL init hasn't completed. 6 years ago
Roger A. Light 07c54627e9 Print OpenSSL errors in more situations
Covers when loading certificates fails, or there are ENGINE problems.

Closes #1552. Thanks to Michael Richardson.
6 years ago
Roger A. Light d60e86d2a3 Add TCP_NODELAY support to lib and clients.
Closes #1526. Thanks to Felix Moessbauer.
6 years ago
Christian Schneider a3ebeff9d7 fix: replace sleep with (p)select in loop_forever
sleep was blocking loop_stop(force=false) since it
was uniteruptible

Signed-off-by: Christian Schneider <cschneider@radiodata.biz>
6 years ago
Roger A. Light c0443637e8 Merge branch 'master'
Conflicts:
	ChangeLog.txt
	config.mk
	src/context.c
	src/loop.c
	src/subs.c
	test/broker/01-connect-bad-packet.py
	test/broker/02-subpub-qos1-bad-pubcomp.py
	test/broker/02-subpub-qos1-bad-pubrec.py
	test/broker/02-subpub-qos2-bad-puback-1.py
	test/broker/02-subpub-qos2-bad-puback-2.py
	test/broker/02-subpub-qos2-bad-pubcomp.py
	test/broker/02-subpub-qos2.py
	test/broker/07-will-null-topic.py
6 years ago
Roger A. Light 47dadb902d Only call ERR_clear_error() after an error has occurred. 6 years ago
Roger A. Light 499e2f2e98 Add support for unix sockets to broker, lib, and clients. 6 years ago
Roger A. Light 6a01453ce0 Build fixes. 6 years ago
Roger A. Light d8f6215569 Windows fix 6 years ago
Roger A. Light 46d12086c9 Set sock to invalid after closing. 6 years ago
Karl Palsson 22303848e2 ssl: support openssl with ENGINE support disabled.
Alternatively, just drop support for this config.

Signed-off-by: Karl Palsson <karlp@etactica.com>
7 years ago
Karl Palsson 0928797e57 lib: fix missing openssl/ui.h include.
Signed-off-by: Karl Palsson <karlp@etactica.com>
7 years ago
Roger A. Light dc4b823f92 Fix crash after client has been unable to connect to a broker
This is part of the cleanup routine when the client is already exiting.

Closes #1246. Thanks to Christoph Krey.
7 years ago
Roger A. Light f041cb484a No need to support versions that aren't supported by upstream. 7 years ago
John Hickey c011be62a4 Bridge TLS Application-Layer Protocol Negotiation
In order to connect to brokers that support both websockets and
mqtt on the same port (such as Amazon IoT), we need to set an
application for the SSL context.  This change allows the specification
of an application by using the `bridge_alpn` configuration token.

Signed-off-by: John Hickey <jjh-github@daedalian.us>
7 years ago
Roger A. Light ea046c2405 Merge branch 'master' of git://github.com/LarsVoelker/mosquitto into LarsVoelker-master 7 years ago