davidstump / SwiftPhoenixClient

Connect your Phoenix and iOS applications through WebSockets!
MIT License
506 stars 146 forks source link

SSL Pinning support after StarScream removal #228

Closed udaypatial closed 1 year ago

udaypatial commented 1 year ago

Hey how can I add SSLPinning support, now that URLSessionWebSocket is used?

udaypatial commented 1 year ago

URLSessionTransport is internal and I am unable to override func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge

dsrees commented 1 year ago

5.2.2 release changes URLSessionTransport to be open

class CustomTransport: URLSessionTransport {
  // Implement your delegate methods to receive your challange
}

let transport: ((URL) -> PhoenixTransport) = { url in CustomTransport(url: url)}
let socket = Socket(endPoint: "https;//example.com", transport: transport)

Let me know if this you still have any issues. Thanks

udaypatial commented 1 year ago

@dsrees This is great. Exactly what I was looking for. Thanks for the quick turnaround.