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.
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.
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.
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.
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.
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.
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.
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.