diff --git a/Package.swift b/Package.swift index 47d7b6c..cb6b395 100644 --- a/Package.swift +++ b/Package.swift @@ -13,7 +13,7 @@ var package = Package( dependencies: [.Target(name: "Turnstile")]), ], dependencies: [ - .Package(url: "https://github.com/vapor/engine.git", majorVersion: 0, minor: 6), - .Package(url: "https://github.com/vapor/json.git", majorVersion: 0, minor: 5) + .Package(url: "https://github.com/vapor/engine.git", majorVersion: 0, minor: 7), + .Package(url: "https://github.com/vapor/json.git", majorVersion: 0, minor: 6) ] ) diff --git a/Sources/TurnstileWeb/OAuth2.swift b/Sources/TurnstileWeb/OAuth2.swift index 3703d63..ed28b83 100644 --- a/Sources/TurnstileWeb/OAuth2.swift +++ b/Sources/TurnstileWeb/OAuth2.swift @@ -33,7 +33,7 @@ public class OAuth2 { /// The Token Endpoint of the OAuth 2 Server public let tokenURL: String - let HTTPClient = BasicClient.self + let HTTPClient = TempHTTPClient() /// Creates the OAuth 2 client diff --git a/Sources/TurnstileWeb/TempHTTPClient.swift b/Sources/TurnstileWeb/TempHTTPClient.swift new file mode 100644 index 0000000..fadfb38 --- /dev/null +++ b/Sources/TurnstileWeb/TempHTTPClient.swift @@ -0,0 +1,24 @@ +// +// HTTPClient.swift +// Turnstile +// +// Created by Edward Jiang on 8/30/16. +// +// + +import HTTP +import Transport +import TLS + +/// Temp HTTP client until we switch to Foundation +class TempHTTPClient: Responder { + func respond(to request: Request) throws -> Response { + let config = try Config( + context: try Context(mode: .client), + verifyCertificates: false + ) + let client = try BasicClient(scheme: request.uri.scheme, host: request.uri.host, port: 443, securityLayer: .tls(config)) + + return try client.respond(to: request) + } +} diff --git a/Tests/TurnstileWebTests/FacebookTests.swift b/Tests/TurnstileWebTests/FacebookTests.swift index 092280b..43a6775 100644 --- a/Tests/TurnstileWebTests/FacebookTests.swift +++ b/Tests/TurnstileWebTests/FacebookTests.swift @@ -18,7 +18,7 @@ import URI class FacebookTests: XCTestCase { var facebook: Facebook! - let HTTPClient = BasicClient.self + let HTTPClient = TempHTTPClient() override func setUp() { let clientID = ProcessInfo.processInfo.environment["FACEBOOK_CLIENT_ID"] ?? ""