add option for selfSigned
This commit is contained in:
parent
275c873880
commit
238d3cb338
@ -146,6 +146,7 @@ case ExtraHeaders([String: String]) // Adds custom headers to the initial reques
|
|||||||
case HandleQueue(dispatch_queue_t) // The dispatch queue that handlers are run on. Default is the main queue.
|
case HandleQueue(dispatch_queue_t) // The dispatch queue that handlers are run on. Default is the main queue.
|
||||||
case VoipEnabled(Bool) // Only use this option if you're using the client with VoIP services. Changes the way the WebSocket is created. Default is false
|
case VoipEnabled(Bool) // Only use this option if you're using the client with VoIP services. Changes the way the WebSocket is created. Default is false
|
||||||
case Secure(Bool) // If the connection should use TLS. Default is false.
|
case Secure(Bool) // If the connection should use TLS. Default is false.
|
||||||
|
case SelfSigned(Bool) // Sets WebSocket.selfSignedSSL (Don't do this, iOS will yell at you)
|
||||||
|
|
||||||
```
|
```
|
||||||
Methods
|
Methods
|
||||||
|
|||||||
@ -67,6 +67,7 @@ public final class SocketEngine: NSObject, SocketEngineSpec, WebSocketDelegate {
|
|||||||
private var probing = false
|
private var probing = false
|
||||||
private var probeWait = ProbeWaitQueue()
|
private var probeWait = ProbeWaitQueue()
|
||||||
private var secure = false
|
private var secure = false
|
||||||
|
private var selfSigned = false
|
||||||
private var session: NSURLSession?
|
private var session: NSURLSession?
|
||||||
private var voipEnabled = false
|
private var voipEnabled = false
|
||||||
private var waitingForPoll = false
|
private var waitingForPoll = false
|
||||||
@ -98,6 +99,8 @@ public final class SocketEngine: NSObject, SocketEngineSpec, WebSocketDelegate {
|
|||||||
voipEnabled = enable
|
voipEnabled = enable
|
||||||
case .Secure(let secure):
|
case .Secure(let secure):
|
||||||
self.secure = secure
|
self.secure = secure
|
||||||
|
case .SelfSigned(let selfSigned):
|
||||||
|
self.selfSigned = selfSigned
|
||||||
default:
|
default:
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@ -255,6 +258,7 @@ public final class SocketEngine: NSObject, SocketEngineSpec, WebSocketDelegate {
|
|||||||
ws?.queue = handleQueue
|
ws?.queue = handleQueue
|
||||||
ws?.voipEnabled = voipEnabled
|
ws?.voipEnabled = voipEnabled
|
||||||
ws?.delegate = self
|
ws?.delegate = self
|
||||||
|
ws?.selfSignedSSL = selfSigned
|
||||||
|
|
||||||
if connect {
|
if connect {
|
||||||
ws?.connect()
|
ws?.connect()
|
||||||
|
|||||||
@ -44,6 +44,7 @@ public enum SocketIOClientOption: ClientOption {
|
|||||||
case ReconnectAttempts(Int)
|
case ReconnectAttempts(Int)
|
||||||
case ReconnectWait(Int)
|
case ReconnectWait(Int)
|
||||||
case Secure(Bool)
|
case Secure(Bool)
|
||||||
|
case SelfSigned(Bool)
|
||||||
case SessionDelegate(NSURLSessionDelegate)
|
case SessionDelegate(NSURLSessionDelegate)
|
||||||
case VoipEnabled(Bool)
|
case VoipEnabled(Bool)
|
||||||
|
|
||||||
@ -95,6 +96,8 @@ public enum SocketIOClientOption: ClientOption {
|
|||||||
return .VoipEnabled(enable)
|
return .VoipEnabled(enable)
|
||||||
case ("secure", let secure as Bool):
|
case ("secure", let secure as Bool):
|
||||||
return .Secure(secure)
|
return .Secure(secure)
|
||||||
|
case ("selfSigned", let selfSigned as Bool):
|
||||||
|
return .SelfSigned(selfSigned)
|
||||||
default:
|
default:
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user