use fromPEMFile in reponsiveness server#104
Conversation
previously used API is deprecated
|
|
||
| let certificate = try NIOSSLCertificate(file: certificatePath, format: .pem) | ||
| let certificate = try NIOSSLCertificate.fromPEMFile(certificatePath) | ||
| precondition(certificate.count == 1) |
There was a problem hiding this comment.
| precondition(certificate.count == 1) | |
| precondition(certificate.count >= 1) |
The previous API ignored everything but the first certificate. In contrast this will fail if the file contains multiple certificates.
There was a problem hiding this comment.
This is true but at the moment the rest of the test is built assuming that there is only one certificate, we only pass along the first. The intention of this precondition is to reflect that and make it clear what is happening if we later change the file and we're ignoring elements of the certificate chain.
There was a problem hiding this comment.
That we used NIOSSLCertificate(file:format:) here is a bug and the motivating reason for deprecating that API.
We should remove the precondition and pass along all certs to the certificateChain.
The previously used initializer is deprecated leading to warnings and CI failures