Skip to content

Commit

Permalink
Added option to allow secure connection over self-signed certificate
Browse files Browse the repository at this point in the history
  • Loading branch information
OrkhanAlikhanov committed Jul 2, 2018
1 parent 848094d commit a507ee9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Request.swift.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Request.swift'
s.version = '2.2.2'
s.version = '2.2.3'
s.summary = 'A (sync/async) tiny http client written in swift.'
s.homepage = 'https://github.com/BiAtoms/Request.swift'
s.license = { :type => 'MIT', :file => 'LICENSE' }
Expand Down
7 changes: 4 additions & 3 deletions Sources/Requester.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ open class Requester {
open var request: Request
open var response: Response?
open var error: Error?
open var handler: ResponseHandler? = nil
open var proxy: Proxy? = nil
open var handler: ResponseHandler?
open var proxy: Proxy?
open var allowSelfSigned = false

public init(request: Request, queue: DispatchQueue, timeout: Int, proxy: Proxy?) {
self.request = request
Expand Down Expand Up @@ -96,7 +97,7 @@ open class Requester {
}

if request.isSecure {
try socket.startTls(.init(peer: hostname))
try socket.startTls(.init(peer: hostname, allowSelfSigned: allowSelfSigned))
}
}

Expand Down

0 comments on commit a507ee9

Please sign in to comment.