swifter
swifter copied to clipboard
SSL support
Motivation
To have SSL support and be able to use HTTPS. The use cases of swifter library will be much broader. Our company use swifter to run mock API server in iOS UI tests (https://github.com/treatwell/twuitests), but currently arbitrary loads have to be enabled in iOS app because iOS enforces using SSL connections.
What's in this PR
This PR introduces SSL support using TLS session on Darwin OS (if everything will turn out fine I'll try adding support for Linux OS as well).
Demo optional localhost
(if appears at ~/.swifter/localhost.p12
) certificate loading is added to SwifterSampleOSX
target.
Closes #111 #395
How did I test it?
Using mkcert
tool:
mkcert -install
mkcert -pkcs12 localhost 127.0.0.1 ::1
and then imported generated .p12
file to System keychain.
1 Error | |
---|---|
:no_entry_sign: | Please include a CHANGELOG entry. You can find it at CHANGELOG.md. |
2 Warnings | |
---|---|
:warning: | It seems like you’ve added new tests to the library. If that’s the case, please update the XCTestManifests.swift file running in your terminal the command swift test --generate-linuxmain . |
:warning: | If you ran the command swift test --generate-linuxmain in your terminal, please remove the line testCase(IOSafetyTests.__allTests__IOSafetyTests), from public func __allTests() -> [XCTestCaseEntry] in the bottom of the file. For more reference see #366. |
1 Message | |
---|---|
:book: | Hey, @viktorasl 👋. |
Generated by :no_entry_sign: Danger
Hey, @viktorasl Thanks for taking the time to create this. I'll try to check your PR during this week, can you please in the meantime fix the issues with Danger? Thanks.
I'll be reviewing more soon and I'll try to test it locally with the certificates also.
I'll probably fix everything after more thorough reviews.
Sure, please let me know to continue with the review as it's a little long.
@viktorasl Are you still interested in this PR? Please continue with the rest of the changes to be able to continue reviewing it 🙂.
Hm, miscommunication happened. I was about to apply changes after your full review. But as I understand that I should apply changes now. I'll do that.
Ups yes it was sorry about that ☹️. Sounds good please apply the changes in order to continue. Thanks again for your PR!
Any news around this? It would be really nice when SSL support is added soon.
@MartyCatawiki @viktorasl I would be reviewing the latest changes ASAP. Sorry for the delay 😞.
Sorry it took me so long. Fixed according to comments, please check it out
@viktorasl I'll during the week! Thanks for the heads up.
@viktorasl Can you please compile your PR with Xcode 11.1. I'm getting errors trying to compile it in order to continue the review. Thanks.
@viktorasl Can you please compile your PR with Xcode 11.1. I'm getting errors trying to compile it in order to continue the review. Thanks.
Found the issue regarding force cast and added swiftlint rule ignore for that one particular line. Hope it solves the problem.
@viktorasl Hi! Could we use this functionality on iOS? Maybe you can add some examples and instructions to the SwifterSampleiOS
?
Hope to see this pull request merged :)
@viktorasl Hi! Could we use this functionality on iOS? Maybe you can add some examples and instructions to the
SwifterSampleiOS
? Hope to see this pull request merged :)
I can look into that 👍 not sure if all APIs are supported on iOS.
Hey @viktorasl Have you had time to take a look at that? I tried to run it on iOS but I had some problems with certificates probably or not - anyway I couldn't make it work on iOS
Hi guys, any update on this feature?
hei, it's that any update for this?
@viktorasl this fork commit use ssl can't send data over 16384 bytes,