@@ -635,33 +635,33 @@ final class AsyncAwaitEndToEndTests: XCTestCase {
635
635
636
636
func testDnsOverride( ) {
637
637
XCTAsyncTest ( timeout: 5 ) {
638
- /// key + cert was created with the following code (depends on swift-certificates)
639
- /// ```
640
- /// import X509
641
- /// import CryptoKit
642
- /// import Foundation
643
- ///
644
- /// let privateKey = P384.Signing.PrivateKey()
645
- /// let name = try DistinguishedName {
646
- /// OrganizationName("Self Signed")
647
- /// CommonName("localhost")
648
- /// }
649
- /// let certificate = try Certificate(
650
- /// version: .v3,
651
- /// serialNumber: .init(),
652
- /// publicKey: .init(privateKey.publicKey),
653
- /// notValidBefore: Date(),
654
- /// notValidAfter: Date().advanced(by: 365 * 24 * 3600),
655
- /// issuer: name,
656
- /// subject: name,
657
- /// signatureAlgorithm: .ecdsaWithSHA384,
658
- /// extensions: try .init {
659
- /// SubjectAlternativeNames([.dnsName("example.com")])
660
- /// try ExtendedKeyUsage([.serverAuth])
661
- /// },
662
- /// issuerPrivateKey: .init(privateKey)
663
- /// )
664
- /// ```
638
+ // key + cert was created with the following code (depends on swift-certificates)
639
+ // ```
640
+ // import X509
641
+ // import CryptoKit
642
+ // import Foundation
643
+ //
644
+ // let privateKey = P384.Signing.PrivateKey()
645
+ // let name = try DistinguishedName {
646
+ // OrganizationName("Self Signed")
647
+ // CommonName("localhost")
648
+ // }
649
+ // let certificate = try Certificate(
650
+ // version: .v3,
651
+ // serialNumber: .init(),
652
+ // publicKey: .init(privateKey.publicKey),
653
+ // notValidBefore: Date(),
654
+ // notValidAfter: Date().advanced(by: 365 * 24 * 3600),
655
+ // issuer: name,
656
+ // subject: name,
657
+ // signatureAlgorithm: .ecdsaWithSHA384,
658
+ // extensions: try .init {
659
+ // SubjectAlternativeNames([.dnsName("example.com")])
660
+ // try ExtendedKeyUsage([.serverAuth])
661
+ // },
662
+ // issuerPrivateKey: .init(privateKey)
663
+ // )
664
+ // ```
665
665
let certPath = Bundle . module. path ( forResource: " example.com.cert " , ofType: " pem " ) !
666
666
let keyPath = Bundle . module. path ( forResource: " example.com.private-key " , ofType: " pem " ) !
667
667
let key = try NIOSSLPrivateKey ( file: keyPath, format: . pem)
0 commit comments