-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Edward Jiang
committed
Aug 30, 2016
1 parent
4ef792a
commit 1dc77e8
Showing
4 changed files
with
28 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters