From 14795f2bfe621445755180e0c3812aabf05c13aa Mon Sep 17 00:00:00 2001 From: Adam Fowler Date: Wed, 3 Apr 2024 18:05:32 +0100 Subject: [PATCH] Skip PKCS12 import when interaction isnt allowed on CI --- Tests/HummingbirdCoreTests/ClientTests.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Tests/HummingbirdCoreTests/ClientTests.swift b/Tests/HummingbirdCoreTests/ClientTests.swift index c5c4e9464..946d684b0 100644 --- a/Tests/HummingbirdCoreTests/ClientTests.swift +++ b/Tests/HummingbirdCoreTests/ClientTests.swift @@ -154,8 +154,14 @@ final class ClientTests: XCTestCase { func testTransportServicesTLSClient() async throws { let p12Path = Bundle.module.path(forResource: "client", ofType: "p12")! let derPath = Bundle.module.path(forResource: "ca", ofType: "der")! + let identity: TSTLSOptions.Identity + do { + identity = try .p12(filename: p12Path, password: "HBTests") + } catch let error as TSTLSOptions.Error where error == .interactionNotAllowed { + throw XCTSkip("Unable to import PKCS12 bundle: no interaction allowed") + } let tlsOptions = try XCTUnwrap(TSTLSOptions.options( - clientIdentity: .p12(filename: p12Path, password: "HBTests"), + clientIdentity: identity, trustRoots: .der(filename: derPath), serverName: testServerName ))