apple / swift-nio-ssl

TLS Support for SwiftNIO, based on BoringSSL.
https://swiftpackageindex.com/apple/swift-nio-ssl/main/documentation/niossl
Apache License 2.0
388 stars 139 forks source link

Invoke `additionalPeerCertificateVerificationCallback` with peer certificate #387

Closed dnadoba closed 2 years ago

dnadoba commented 2 years ago

Motivation

We want that users can do additional verification of the peer certificate without completely disabling the default certificate chain verification. additionalPeerCertificateVerificationCallback is called after the normal certificate chain verification was successful but still gives the user the possibility to accept or reject a connection asynchronously based on the peer certificate.

Modifications

Result

Users can now easily do custom peer certificate validation while still getting the system/BoringSSL provided full certificate chain validation.