swifter icon indicating copy to clipboard operation
swifter copied to clipboard

SSL Support

Open satishmaha opened this issue 9 years ago • 23 comments

https://github.com/PerfectlySoft/Perfect allows the ability to start the server with a cert+key. Since HTTPS is now recommended everywhere, along with initiatives like https://letsencrypt.org, what do you think?

satishmaha avatar Feb 29 '16 04:02 satishmaha

:+1: thanks for this report !

I am going to add OpenSSL soon.

Best

damian-kolakowski avatar Feb 29 '16 09:02 damian-kolakowski

Super! Please let me know if you need QA/Testing

Thank you for all your hard work into this lib :)

satishmaha avatar Feb 29 '16 09:02 satishmaha

Any update on this? This library is very easy to use, but I need to run my local server in https in production.

bizz84 avatar Apr 09 '16 20:04 bizz84

I love the library, but I need to use https in production (and we are moving to production very soon).

Please give an ETA on this.

Thanks!

Laban1 avatar Apr 14 '16 17:04 Laban1

We really want to use this in production but can't yet because https isn't there. Any update on when it might be ready? Thanks!

JBlitter avatar Apr 18 '16 14:04 JBlitter

Hi all, any reason why you could not stick nginx in front of your swifter servers?

julien-c avatar Apr 18 '16 14:04 julien-c

@julien-c: I have never used nginx, but adding proxies to the mix adds additional points of failure & maintenance, especially when you are dealing with ~100 tablets spread out over several locations with no IT staff on-site. Further, would not the traffic between the nginx server and the tablets still be over HTTP?

Laban1 avatar Apr 18 '16 23:04 Laban1

If you use nginx as a reverse proxy just for SSL termination, the maintenance overhead will be minimal. This is literally 4 lines of nginx configuration.

julien-c avatar Apr 19 '16 06:04 julien-c

@julien-c: we would still need to install an nginx server at each location and then keep it updated and secure (sensitive data) and if it breaks it affects all tablets at the location. Further, the connection between the proxy and each tablet would still not be secure. In our scenario we are required to use SSL all the way to each tablet.

Laban1 avatar Apr 19 '16 14:04 Laban1

Hi all,

I was not able to find another Swift iOS web server and need only part of the traffic encrypted, so I used this this library: https://github.com/TakeScoop/SwiftyRSA to accomplish this. In brief, here is what I did:

  1. Created a key pair (RSA 2048 bit) on the Linux server that is interacting with the iPads
  2. Created a web service method to send the public key to the iPads and store it in the key chain.
  3. When sensitive data needs to be sent from the iPads to the server, I use the public key to encrypt it (so that it gets sent as a Base64 encoded encrypted data)
  4. The server decodes the Base64 and then uses the private key to decrypt the data

This seems to work very well and was easy to implement, so I figured I share it here in case somebody else is in a similar situation.

Note: RSA 2048 can only encrypt up to 245 bytes, so if you need to encrypt more data you can use the RSA keys to exchange a symmetric key to do the encryption of larger amount of data with (the same as TLS does).

Laban1 avatar May 10 '16 02:05 Laban1

SSL support would be great. Apple is making it harder and harder to do regular HTTP requests.

In my case I would like a few iPads to securely communicate with each other. Unfortunately iOS, nor any third party project that I could find, offers a server with HTTPS support.

yvbeek avatar Sep 30 '16 07:09 yvbeek

No SSL support? what is this @glock45 1999? #justkidding

krzyzanowskim avatar Dec 05 '16 16:12 krzyzanowskim

@krzyzanowskim There is some work here https://github.com/httpswift/swifter/tree/master/Sources/TLS 👍

damian-kolakowski avatar Dec 05 '16 18:12 damian-kolakowski

really need

voynovia avatar Dec 22 '16 18:12 voynovia

Any plans to resume work on SSL support?

mgfeldman avatar Feb 16 '17 00:02 mgfeldman

I'd also love this - the library looks and feels great but not having SSL is an issue :/

Daij-Djan avatar Apr 21 '17 14:04 Daij-Djan

Yesterday I've open-sourced our web server Telegraph: https://github.com/Building42/Telegraph

It has SSL support if you guys are still looking for it.

yvbeek avatar Apr 23 '17 17:04 yvbeek

very nice. thanks

Daij-Djan avatar Apr 23 '17 20:04 Daij-Djan

@Zyphrax Thanks, I'll give it a shot!

mgfeldman avatar Apr 24 '17 17:04 mgfeldman

No problem, if you have any feedback, let me know.

yvbeek avatar Apr 25 '17 01:04 yvbeek

I should also mention https://github.com/BiAtoms/Http.swift which has SSL/TLS support.

jeff-h avatar Mar 19 '18 09:03 jeff-h

@glock45 Any plans to resume the SSL work?

Laban1 avatar May 01 '18 21:05 Laban1

@krzyzanowskim There is some work here https://github.com/httpswift/swifter/tree/master/Sources/TLS 👍

how to use this?

linhaosunny avatar Jun 18 '24 01:06 linhaosunny