Я делаю приложение, которое использует API-диск Discord. Я должен использовать веб-сокеты для подключения к шлюзу, но он всегда выдает ошибку, когда я пытаюсь подключиться. Я использую фреймворк Starscream. Кто-нибудь знает как это исправить?
let socketHandler = SocketHandler(url: "wss://gateway.discord.gg/?v=6&encoding=json")
class SocketHandler: WebSocketDelegate {
var socket: WebSocket
func didReceive(event: WebSocketEvent, client: WebSocket) {
print("received")
}
init(url: String) {
self.socket = WebSocket(request: URLRequest(url: URL(string: url)!))
self.socket.delegate = self
socket.connect();
}
}
2020-02-07 20:09:35.452134+0100 DisChat WatchKit Extension[247:10072] [BoringSSL] boringssl_context_handle_fatal_alert(1872) [C1.1:1][0x1451d7f0] write alert, level: fatal, description: certificate unknown
2020-02-07 20:09:35.452923+0100 DisChat WatchKit Extension[247:10072] [BoringSSL] boringssl_context_error_print(1862) boringssl ctx 0x145fa5a0: 361843784:error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED:/BuildRoot/Library/Caches/com.apple.xbs/Sources/boringssl/boringssl-283.60.3/ssl/handshake.cc:369:
2020-02-07 20:09:35.458630+0100 DisChat WatchKit Extension[247:10072] [BoringSSL] boringssl_session_handshake_error_print(111) [C1.1:1][0x1451d7f0] 361843784:error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED:/BuildRoot/Library/Caches/com.apple.xbs/Sources/boringssl/boringssl-283.60.3/ssl/handshake.cc:369:
2020-02-07 20:09:35.458713+0100 DisChat WatchKit Extension[247:10072] [BoringSSL] nw_protocol_boringssl_handshake_negotiate_proceed(726) [C1.1:1][0x1451d7f0] handshake failed at state 12288
wss://gateway.discord.gg/?v=6&encoding=json
2020-02-07 20:09:37.501177+0100 DisChat WatchKit Extension[247:10046] [BoringSSL] boringssl_context_handle_fatal_alert(1872) [C2.1:1][0x1453aab0] write alert, level: fatal, description: certificate unknown
2020-02-07 20:09:37.501307+0100 DisChat WatchKit Extension[247:10046] [BoringSSL] boringssl_context_error_print(1862) boringssl ctx 0x1453d6a0: 341008120:error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED:/BuildRoot/Library/Caches/com.apple.xbs/Sources/boringssl/boringssl-283.60.3/ssl/handshake.cc:369:
2020-02-07 20:09:37.502026+0100 DisChat WatchKit Extension[247:10046] [BoringSSL] boringssl_session_handshake_error_print(111) [C2.1:1][0x1453aab0] 341008120:error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED:/BuildRoot/Library/Caches/com.apple.xbs/Sources/boringssl/boringssl-283.60.3/ssl/handshake.cc:369:
2020-02-07 20:09:37.502050+0100 DisChat WatchKit Extension[247:10046] [BoringSSL] nw_protocol_boringssl_handshake_negotiate_proceed(726) [C2.1:1][0x1453aab0] handshake failed at state 12288