mirror of
https://github.com/apple/swift-nio-ssl
synced 2026-11-22 04:30:44 +00:00
Motivation: In #550 a use of `NIOSSLCertificafe(file:format:)` was replaced with `NIOSSLCertificafe.loadPEMFile(_:).first`, which isn't necessarily the same (the error flow is different for one). To avoid any subtle behaioral changes revert back to the old API in that one instance. Modifications: - Use old API Result: Fewer behavioural changes
This commit is contained in:
1 parent
5108dbdec9
commit
385f5bd783
2 files changed
+3
-4
No files matched your search
@@ -106,7 +106,7 @@ public final class NIOSSLCertificate {
|
||||
/// - parameters:
|
||||
/// - file: The path to the file to load the certificate from.
|
||||
/// - format: The format to use to parse the file.
|
||||
private convenience init(_file file: String, format: NIOSSLSerializationFormats) throws {
|
||||
internal convenience init(_file file: String, format: NIOSSLSerializationFormats) throws {
|
||||
let fileObject = try Posix.fopen(file: file, mode: "rb")
|
||||
defer {
|
||||
fclose(fileObject)
|
||||
|
||||
@@ -688,9 +688,8 @@ extension NIOSSLContext {
|
||||
// Load only the certificates that resolve to an existing certificate in the directory.
|
||||
for symPath in certificateFilePaths {
|
||||
// c_rehash only support pem files.
|
||||
if let cert = try NIOSSLCertificate.fromPEMFile(symPath).first {
|
||||
try addCACertificateNameToList(context: context, certificate: cert)
|
||||
}
|
||||
let cert = try NIOSSLCertificate(_file: symPath, format: .pem)
|
||||
try addCACertificateNameToList(context: context, certificate: cert)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user