Using unsecure Websocket connection¶
Sometimes, a server may use self-signed Websocket SSL certificates in staging environments. iOS applications do not accept such certificates by default.
Since iOS SDK build 2.6.130 the disableSSLValidation connection option may be used to bypass this limit
@IBAction func connectPressed(_ sender: Any) {
changeViewState(connectButton, false)
if (connectButton.title(for: .normal) == "CONNECT") {
if (session == nil) {
let options = FPWCSApi2SessionOptions()
options.urlServer = urlField.text
options.appKey = "defaultApp"
options.disableSSLValidation = disableSSLValidation.isOn;
do {
session = try WCSSession(options)
} catch {
print(error);
}
}
...
session?.connect()
} else {
session?.disconnect()
}
}
In this case, Websocket connection will be established over HTTP.
Attention
Please do not use this option in production environment!