adamhartford / SwiftR

Swift client for SignalR (iOS and Mac)
MIT License
174 stars 74 forks source link

Ignore SSL on SignalR #107

Open brunosenaa opened 6 years ago

brunosenaa commented 6 years ago

When I implement server without https everything works fine.

But, when I try to connect with a server through https IOS shows error -1202 (Error during negotiation).

At Android I've bypassed ssl and everything works, but in IOS I do not found anything at SignalR class to access NSURLConnection and bypass this scenario.

Could you please help me ?

Thanks

udayasri commented 6 years ago

Hi I had the same issue very recently, because UIWebView / UKWebview wasn't able to do the self signing with SSL certificates or the SSL certificates were not trusted. the workaround was add the exception domains in the info.plist under NSAppTransportSecurity :

Check these link https://cocoacasts.com/how-to-add-app-transport-security-exception-domains https://stackoverflow.com/questions/31254725/transport-security-has-blocked-a-cleartext-http

CR34L commented 6 years ago

Same here. Unable to make connections to selfsigned SSL cert servers. NSAppTransportSecurity is not an option any more.

NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813) HTTP load failed (error code: -1202 [3:-9813])

Any known workarounds?

adamhartford commented 6 years ago

You could install your own root certificate and trust it via Settings > General > About > Certificate Trust Settings.

https://developer.apple.com/library/content/qa/qa1948/_index.html