Error: Optional(["message": Error during negotiation request.])
我发现了错误,而连接signalr服务器,我想有一个与服务器端,因为它们使用自签名证书的问题。 如何我可以通过客户端(SWIFT)确定,如何启用iOS中11自签名证书的工作? 对于签名库。
下面是我的代码:
func test() {
let persistentConnection = SignalR("http://services.test.com/signalr", connectionType: .persistent)
let simpleHub1 = Hub("testHub")
persistentConnection.useWKWebView = false
persistentConnection.addHub(simpleHub1)
persistentConnection.received = { data in
print(data)
}
persistentConnection.connected = { [weak self] in
print("Connected. Connection ID: \(String(describing: self!.hubConnection.connectionID))")
}
persistentConnection.starting = { [weak self] in
print("Starting...")
}
persistentConnection.reconnecting = { [weak self] in
print("Reconnecting...")
}
persistentConnection.connected = { [weak self] in
print("Connected. Connection ID: \(String(describing: self!.hubConnection.connectionID))")
}
persistentConnection.reconnected = { [weak self] in
print("Reconnected. Connection ID: \(String(describing: self!.hubConnection.connectionID))")
}
persistentConnection.disconnected = { [weak self] in
print("Disconnected.")
}
persistentConnection.connectionSlow = { print("Connection slow...") }
persistentConnection.error = { [weak self] error in
print("Connection timed out. Restarting...")
persistentConnection.start()
}
}
persistentConnection.start()
}