admin管理员组文章数量:1410674
I have created self sign certificate and write code as below to start local server with SSL signed certificates
init() throws {
// Configure TLS
let tlsOptions = NWProtocolTLS.Options()
do {
try configureTLS(tlsOptions)
} catch {
throw error
}
// Disable strict certificate validation (DEBUG ONLY)
sec_protocol_options_set_verify_block(tlsOptions.securityProtocolOptions, { sec, trust, complete in
complete(true) // Always trust (Only for local testing!)
}, DispatchQueue.global())
print("TLSOption : \(tlsOptions)")
// Create NWParameters
let parameters = NWParameters(tls: tlsOptions)
parameters.allowLocalEndpointReuse = true
parameters.includePeerToPeer = true
// WebSocket options
let webSocketOptions = NWProtocolWebSocket.Options()
webSocketOptions.autoReplyPing = true
parameters.defaultProtocolStack.applicationProtocols.append(webSocketOptions)
// Create listener
self.listener = try NWListener(using: parameters, on: self.port)
}
when start server then it works fine on this url ws://192.168.11.223:8080 but when I hit wss://192.168.11.223:8080 then it not connected.
How to start local server for websocket with wss://
本文标签: How to start local server with websocket for WebRTC with SSL certificate in iOS swiftStack Overflow
版权声明:本文标题:How to start local server with websocket for WebRTC with SSL certificate in iOS swift? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744995422a2636640.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论