9 Commits
Author SHA1 Message Date
Cory Benfield f1baaad333 Clean up Sendability issues in examples & performance tester (#528) 2025-04-11 10:13:37 +00:00
Rick Newton-Rogers 61cfaf9798 Migrate to GitHub Actions (#487)
Migrate CI to use GitHub Actions.

### Motivation:

To migrate to GitHub actions and centralised infrastructure.

### Modifications:

Changes of note:
* Disable warnings-as-errors until issues with recent NIO changes are
resolved
* Adopt swift-format using rules from SwiftNIO
* Remove scripts which are no longer needed

### Result:

Feature parity with old CI minus allocation tests which remain on the
old CI.
2024-10-25 09:32:23 +01:00
Ayush Garg a9fa5efd86 Mark .file case deprecated for NIOSSLPrivateKeySource (#474)
swift-nio-ssl expects file to in specific format when loading the PrivateKey from a file baed on the extension of the file. This is prone to errors, since there is no standard agreement on the extension and format of the file. 
An example of a mismatch is `.key` swift-nio-ssl tries to load such file as DER, though these can be in PEM format too.

We could based on the binary contents of the file provided infer the format of the file, but it doesn't seem like a logic this library should own. The clients should be able to load the file themselves. 

In this PR  `.file` case is marked deprecated and relevant deprecation flags and documentation is added to point to the preferred option.
2024-07-29 03:10:26 -07:00
Cory Benfield c359ba56f7 Clean up imports and dependencies (#319)
Motivation:

With NIO 2.32.0 we broke the core NIO module up into modules that split
apart the POSIX layer and the core abstractions. As a result, this
package no longer needs to express a hard dependency on the POSIX layer.

Modifications:

- Rewrote imports of NIO to NIOCore.
- Added NIOEmbedded and NIOPosix imports where necessary in tests.
- Extended soundness script to detect NIO imports.
- Note that the main modules still depend on NIO, which is necessary
for backwards-compatibility reasons. This dependency is unused.

Result:

No need to use NIOPosix.
2021-09-14 14:55:25 +01:00
Cory Benfield 9c457d021e Rationalise TLSConfiguration construction. (#299)
Motivation:

Currently whenever we add new config to TLSConfiguration, we add a new
static factory function that needs to provide the field. This is because
we currently allow configuration primarily by way of initializers. This
is increasingly not scaling, leading to a proliferation of almost
identical static factory functions.

We can replace this proliferation by having only "default" constructions
that default basically everything, and then having users use
getters/setters to initialize things. This also works well when we have
multiple ways of interacting with config, e.g. with the various cipher
suite operations.

Modifications:

- Deprecate all existing factory functions.
- Replace with two: forClient() and
  forServer(certificateChain:privateKey:). These configure only the
  mandatory things for each mode.
- Replace all uses of the deprecated initializers with the new ones,
  configuring fields manually as needed.

Result:

More consistent configuration objects.
2021-05-14 08:52:26 +01:00
Matt Eaton 6ee46effd1 Swapped applicationProtocols check for encodedApplicationProtocols. (#184)
Motivation:

Resolution on issue-151.
Adding a README for NIOTLSServer.

Modifications:

Swapped applicationProtocols check with encodedApplicationProtocols.
Added a README for NIOTLSServer.
Altered the README for NIOSSLHTTP1Client.

Result:

Updated documentation and swapped ALPN checks during SSLContext
initialization.
2020-02-17 08:08:26 +00:00
George Barnett 7eb0321337 Add loading of multiple certificates from a single PEM file/buffer (#123)
Motivation:

It is only possible to load multiple certificates from a PEM file,
sometimes it is useful to load multiple certificates from a buffer.

Modifications:

- Deprecate the `.file` source of loading a certificate, since it would
  only load the first certificate in a file.
- Provide methods for loading multiple certificates from a PEM file or
  buffer.

Result:

Multiple certificates can be loaded from a PEM file/buffer.
2019-08-09 16:52:02 +01:00
Cory Benfield 06eea9ac37 Support renegotiation-based client auth. (#111)
Motivation:

While TLS renegotiation is in general a bad idea, it is widely used for
delayed TLS-based client authentication. We are able to support this
use-case, and so we should enable it.

As with BoringSSL, we'd like to continue to default to not supporting
this mode of operation. However, users are free to enable support if
they so choose.

Modifications:

- Added flags for configuring renegotiation.
- Added integration test harness.
- Added renegotiation integration test with s_server.
- Added renegotiation and client cert support to sample client.

Result:

Users will be able to perform TLS renegotiation.
2019-06-26 21:08:31 +01:00
Johannes Weiss f9ac0c3486 prevent duplicate targets: rename NIOHTTP1Client to NIOSSLHTTP1Client (#99)
Motivation:

With package editing this problem surfaces:

```
$ jw-swift-5.0 swift test
error: multiple products named 'NIOHTTP1Client' in: swift-nio, swift-nio-ssl
error: multiple targets named 'NIOHTTP1Client' in: swift-nio, swift-nio-ssl
```

which is bad. Fortunately, these are executable targets that we can
rename.

Modification:

rename `NIOHTTP1Client` in swift-nio-ssl to `NIOSSLHTTP1Client`

Result:

usable with package editing.
2019-04-11 18:32:59 +01:00