AutosoftDMS / SignalR-Swift

SignalR client library written in pure Swift
MIT License
60 stars 55 forks source link

a self-signed SSL certificate support #9

Closed vldalx closed 7 years ago

vldalx commented 7 years ago

This pull request is a suggestion how possible to add a self-signed certificate support. It would be nice to have that feature for a testing purpose.

How to use:

  1. Create a [Hub]Connection instance and pass an Alamofire SessionManader through a class initializer. How to connect to self-signed servers using Alamofire.

  2. Set property webSocketAllowsSelfSignedSSL of the Connection instance to true value.

let hubConnection = HubConnection(withUrl: ..., sessionManager: ...)
hubConnection.webSocketAllowsSelfSignedSSL = true
vldalx commented 7 years ago

@jordancamara Hi. Will you merge the pull request? It's a very useful feature. If you don't like the approach, let's make something else. The main idea is the library shell works with a self-signed SSL certificate.

jordancamara commented 7 years ago

@vldalx I will review it here shortly. Sorry, it's something I meant to get to on Friday but got lost in the kerfuffle.