Building42 / Telegraph

Secure Web Server for iOS, tvOS and macOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Secure WebSocket client (https) cannot connect to WebSocket server (ws)

HakanPamukcu opened this issue · comments

First I thanking you for the great tutorial.

My problem is that after successfully launching the application, I opening the https url in the default iOS device browser (Safari) in the WKWebView of the application. The connection request of the screen that opens reaches the WebSocket Server (ws), but the connection is not successful.

Is it necessary to give the CA certificate to the WebSocket server for this problem solution? Is a non-certified solution possible?

Environment:
Xcode 12.2
Install Telegraph library via - Swift Package Manager
Tested device: iPad Air2 - OS Version (14.4)

Hi, are you running into a certificate error?

If you like you can run the server without HTTPS by simply not providing an identity and caCertificates when you create the Server instance.

The best way to try this out is to clone the Telegraph repo, open the Xcode project and then start the iOS example. If you comment out the loadCertificates() line in TelegraphDemo.swift, it will start a server without certificates.