4 Commits
Author SHA1 Message Date
Cory Benfield c1bcde58f6 Revert to @_implementationOnly import (#562)
Motivation:

Unfortunately, `internal import` doesn't do implementation-hiding in the
build system. This means that the C header files do become visible to
all dependencies, which can cause problems when the ssl.h headers from
elsewhere are included.

Modifications:

Revert to `@_implementationOnly` imports.

Result:

Better builds, unfortunately more warnings
2025-10-28 15:52:53 +00:00
hamzahrmalik 6ae36f2273 Make sslContextCallback overrides replace the existing chain, rather than adding to it (#557)
Currently, the certs returned by the sslContextCallback are added to the
context, rather than replacing the certs already in the context.

This means that, if a callback is used to return a new chain to be used,
the old and new chains are both presented (but only the new leaf). This
should not cause any problem, but it is inefficient

Change: Clear the additional certs before adding the new ones
2025-09-16 15:29:14 +01:00
Cory Benfield a919f04adb Swap some implementation only imports to internal imports (#521) 2025-04-11 09:14:31 +00:00
Cory Benfield 3cb4d5ad12 Correctly override connection state using sslContextCallback (#499)
Motivation:

The sslContextCallback overrides modify the SSL_CTX object itself.
That's not useful: in addition to having a global effect, which is
rarely what we want, certain modifications don't apply that late, and
setting the credentials is one of them. The result is that the callback
didn't actually do anything. Not that useful.

Modifications:

- Extract the cert chain setting functions from NIOSSLContext and move
them to general-purpose functions.
- Add support there for calling them on a SSL * as well as on a SSL_CTX
*
- Call them in an override function on SSLConnection
- Call that!
- Add a bunch of tests.

Result:

The callback actually does what it should.
2024-12-18 10:57:06 +00:00