aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* nng_aio_start should imply resetGarrett D'Amore2025-10-10
|
* aio.c - include file fixesGarrett D'Amore2025-10-10
|
* nng_aio_finish should take nng_err rather than intGarrett D'Amore2025-10-10
|
* header file refactoring for IWYU (protocols)Garrett D'Amore2025-10-10
| | | | | | | This changes the header files mostly in the protocols to include directly rather than through the commmon nng_impl.h header. This should lead to faster compiles, and by properly making all includes relative should reduce friction with language servers and other tooling.
* fixes #1868 Add nng_http_[remote,local]_address APIs.Garrett D'Amore2025-10-09
|
* header file fixesGarrett D'Amore2025-10-09
|
* fixes #2133 websocket: new header iteration optionsGarrett D'Amore2025-10-08
|
* options: string options are passed by referenceGarrett D'Amore2025-10-07
| | | | | | | This avoids needless allocations, and we offer for pipes (which need this because they might be ephemeral) the get_strdup, get_strcpy, and get_strlen forms. (Those do the copying or allocations while holding the pipe reference.)
* http: implement nng_http_next_headerGarrett D'Amore2025-10-07
|
* fixes #2173 New TLS cert API - replaces the properties for CN and ALTNAMES.Garrett D'Amore2025-10-05
| | | | | | This will replace the NNG_OPT_TLS_PEER_ALTNAMES and NNG_OPT_TLS_PEER_CN properties, and gives a bit more access to the certificate, as well as direct access to the raw DER form, which should allow use in other APIs.
* Various header file fixes... also fix compilation errors when HTTP is disabled.v2.0.0-alpha.6Garrett D'Amore2025-10-05
| | | | | | Also, some instances nni_aio are changed to nng_aio. We think we want to harmonize some of these types going forward as it will reduce the need to include headers hopefully letting us get away with just "defs.h" in more places.
* fixes #2158 Implement support for NNG_OPT_TLS_PEER_CN for WolfSSLGarrett D'Amore2025-10-05
| | | | | | | This also provides an implementation for getting ALT names, although nothing uses that yet. We plan to provide a new certificate API to replace these with a nicer API, as obtaining the full list of certs may be unreasonable.
* adds nng_dialer_start_aio (#2163)Jon Gjengset2025-10-04
| | | | | | | | | | | | | | | | | | | | | | | | | | * adds nng_dialer_start_aio This change adds `nng_dialer_start_aio` (if you have a better name, I'm happy to change it), whose docs read: > `nng_dialer_start_aio` starts the endpoint dialing asynchronously. > This is only possible if the dialer is not already dialing. Unlike > `nng_dialer_start`, this accepts an AIO such that the caller can learn > when the dialing eventually succeeds or fails. The supplied AIO must > have been initialized, and is only triggered with the result of the > first dial attempt. This new function makes it possible for applications to perform a non-blocking dial, but still later be notified of the result of that dial. Arguably, this obviates the need for `NNG_FLAG_NONBLOCK` in `dialer_start` altogether, but no need to break backwards compatibility. There is technically a functional change here, which is that the "Starting dialer for socket" message now gets printed _before_ the dial is complete in the blocking case, rather than after. It's possible to change this if we're willing to make the code slightly more complicated, but given it says "Starting", not "Started", this change felt fine.
* tests: Add test for serving http static binaryGarrett D'Amore2025-10-04
|
* fixes #2165 nng_http_handler_alloc_static crashes if content type is nullGarrett D'Amore2025-10-04
|
* remaps EAI_AGAIN to NNG_EADDRINVAL (#2169)Jon Gjengset2025-10-04
| | | | | | | | | | | | | | | | | | | | | | | | When running nng tests in CI under nix on Linux, I would see `nng_dialer_start` fail with `NNG_EAGAIN` when invoked with `flags = 0` and a URL of `tcp://999.888.777.666:8080` (this is in a test that is supposed to check that dialing that gives you `NNG_EINVAL` or `NNG_EADDRINVAL`). This can happen if `nni_resolv_ip` in `posix_resolv_gai.c` gets `EAI_AGAIN` from `getaddrinfo`, which the man pages suggest _can_ happen due to "a temporary failure in name resolution". In the nix case, this is due to the nix build sandbox, but it can also arise simply due to DNS overload or misconfiguration. In either case, nng should not bubble up `EAI_AGAIN` `as `NNG_EAGAIN` from `nng_dialer_start`, as `NNG_EAGAIN` has a different semantic meaning. `NNG_EAGAIN` is more equivalent to "would block", and should only be generated through calls with the `NONBLOCK` flag. We don't have a perfect mapping for `EAI_AGAIN`, but the closest is probably `NNG_ADDRINVAL` to indicate that we failed to resolve the given address (even if it's temporary). Another option would be to introduce another error variant like `NNG_ENAMELOOKUP`, but that felt excessive to cover this case.
* dtls: Add a test for "large" (1K) messagesGarrett D'Amore2025-09-28
|
* Fix nuts colors to match acutest.Garrett D'Amore2025-09-28
|
* defs: Fix incorrect define of NNI_PUTLEXX macros.Garrett D'Amore2025-09-28
| | | | | This was responsible for breaking DTLS, and likely other things we never noticed, if the pointer passed in was not already a uint8_t *.
* Fix dtls reconnect attempts.Garrett D'Amore2025-09-14
| | | | | | Once a DTLS client is started and has reasonably resolved things, it will restart message connections; this way we can restart after a failed connection attempt (e.g. if the CERT was bad or something.)
* Only log aborted connections at debug.Garrett D'Amore2025-09-14
| | | | This is occurs normally on socket close and the error messages were alarming.
* mbedtls: reduce logging for debug crypto to debug logGarrett D'Amore2025-09-14
| | | | Warning level was just too noisy.
* dtls - additional test casesGarrett D'Amore2025-09-14
|
* dtls: use nng_err instead of int everywhereGarrett D'Amore2025-09-14
|
* Bump socket common socket stats for PUBGarrett D'Amore2025-09-09
|
* fixes #2148 Old id_reg_map seems not be freedGarrett D'Amore2025-08-25
| | | | | This simplifies the code to just use a precompiled static list. This should be lighter weight, and provably free from leaks.
* MbedTLS: CLOSE NOTIFY is not not really an error.Garrett D'Amore2025-08-25
| | | | The ECONNREFUSED result was causing consternation for some consumers.
* fixes #2150 build error if HTTP support is disabled.Garrett D'Amore2025-08-24
|
* Disable illumos event ports until we can debug them.Garrett D'Amore2025-08-24
|
* Improve tests for SUNOS socketpair.Garrett D'Amore2025-08-24
|
* Add zone.h for illumos zones.Garrett D'Amore2025-08-24
|
* OmniOS fixes.Garrett D'Amore2025-08-24
| | | | | It is a bit of a mystery how we were passing CI/CD with all these problems. Probably we were falling back to select/poll instead of using ports.
* Fix build error on omnios.Garrett D'Amore2025-08-24
|
* Fix omnios clang-19 not foundGarrett D'Amore2025-08-24
|
* Minor spelling fixes.Garrett D'Amore2025-08-24
|
* fixes #2146 need statistics for PUB protocolGarrett D'Amore2025-08-24
|
* dtls: only run the completion if we actually cancelledv2.0.0-alpha.5Garrett D'Amore2025-07-13
|
* DTLS: hold tls configurationGarrett D'Amore2025-07-13
|
* TLS: eliminate more runtime ops vectorsGarrett D'Amore2025-06-30
|
* TLS: Configuration does not need to keep a reference to the engine.Garrett D'Amore2025-06-29
| | | | This may resolve a surprising NULL pointer dereference.
* posix tcp: use after free in listener (need to stop before free)Garrett D'Amore2025-06-22
|
* TLS: fixes for test coverage and improved identification logging.Garrett D'Amore2025-06-22
|
* Hold the pipe across for the DTLS rx cb.Garrett D'Amore2025-06-22
|
* dtls: stop the pipe to solve use after freeGarrett D'Amore2025-06-21
|
* TLS: Remove support for dynamic engine initialization.Garrett D'Amore2025-06-21
| | | | | This saves some atomic lookups, and avoids possible races when the engine is not yet initialized or being torn down.
* Drop mbedtls CTR_DRBG pseudo-random number generator.Garrett D'Amore2025-06-21
| | | | | We never use or test this code, and its better to not have it if nobody is using it.
* tls: false is not a numberGarrett D'Amore2025-06-21
|
* UDP: Signficant refactoring and simplification.Garrett D'Amore2025-06-08
| | | | | | | | | | | | | | This work is inspired by the DTLS work, and harmonizes the UDP implementation with DTLS somewhat. This should make it more resilient to failures, although there is no longer any attempt to guard against sequencing (reorders, dupes) errors. Applications that need such protection should either add it themselves, or use a transport which provides that guarantee (such as TCP). Note that with devices and and such in the way, such guarantees have never been perfect with SP anyway. The UDP transport header sizes for this are now just 8 bytes (beyond the UDP header itself.
* UDP: constify sockaddrs in some placesGarrett D'Amore2025-06-07
|
* fixes mbedtls 3.6.3 handshake with NULL server nameelijahr2025-06-02
| | | | | | | | | | | | | | | | An explicit call to `mbedtls_ssl_set_hostname(NULL)` is now required if the hostname should not be verified in handshake. From the mbedtls changelog: ``` = Mbed TLS 3.6.3 branch released 2025-03-24 Default behavior changes * In TLS clients, if mbedtls_ssl_set_hostname() has not been called, mbedtls_ssl_handshake() now fails with MBEDTLS_ERR_SSL_CERTIFICATE_VERIFICATION_WITHOUT_HOSTNAME if certificate-based authentication of the server is attempted. This is because authenticating a server without knowing what name to expect is usually insecure. To restore the old behavior, either call mbedtls_ssl_set_hostname() with NULL as the hostname, or enable the new compile-time option MBEDTLS_SSL_CLI_ALLOW_WEAK_CERTIFICATE_VERIFICATION_WITHOUT_HOSTNAME. ```