mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-26 12:45:52 +03:00
[GH-ISSUE #54] Support for Self Signed SSL certificates #36
Labels
No labels
bug
cocoapod
duplicate
enhancement
feature-request
help wanted
help wanted
invalid
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/OAuthSwift#36
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @acoleman-apc on GitHub (Apr 19, 2015).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/54
It would be great if you would factor the code found here:
http://stackoverflow.com/questions/24063927/swift-how-to-request-a-url-with-a-self-signed-certificate
Into your project as it would allow for the use of self-signed SSL certificates with your plug in.
This could would need to be added to the OAuthSwiftHTTPRequest.swift file and re-factored to change the "www.myhost.com" line to match the expected host.
Thanks
@phimage commented on GitHub (Dec 1, 2015):
NSURLConnectionis no more used replaced byNSURLSessionwithOAuthSwiftHTTPRequestasNSURLSessionDelegateIn the two case there is more to do than stackoverflow code, many way to valid or not (always trust (bad), user/password credential, certificate), count failure, ...
Without an example of server I can't test or develop something, so I will close
If this is necessarry(request it) a delegate parameters could be added to
OAuthSwiftHTTPRequestto let framework user custom the behavioursNSURLSessionTaskDelegate could be used intead of NSURLSessionDelegate
Some code
https://github.com/search?l=swift&q=didReceiveChallenge+&type=Code&utf8=%E2%9C%93
https://gist.github.com/edwardmp/df8517aa9f1752e73353
@makeitTim commented on GitHub (Sep 18, 2017):
Was this (or a way to set my own delegate) ever implemented?
I am using my own id provider, so in the development environment it's a created SSL cert. So this is needed.
@phimage commented on GitHub (Sep 19, 2017):
@makeitTim
You can set your own url session delegate for all url session created by oauthswift
And some framework methods use
URLSessionFactoryas parameter, for advanced use, and use another factory.@makeitTim commented on GitHub (Sep 19, 2017):
Thanks! I just found the SessionFactory struct and have been trying to figure out how to use it.
Xcode does not like the code you gave me,
default can only appear in a switch statement. I cannot get it to run.The convention for singleton naming in Swift seems to be shared:
@phimage commented on GitHub (Sep 19, 2017):
I agree with naming bug with swift 3 you can use
defaultI edit the code, by replacing
;by=@makeitTim commented on GitHub (Sep 19, 2017):
Thanks for the quick response... I don't follow you? What would allow swift to use a variable named
default?@phimage commented on GitHub (Sep 19, 2017):
This not a forbidden keyword, go to the
URLSessionFactorycode and you will seeJust ass some magic quote and you can use default
@makeitTim commented on GitHub (Sep 19, 2017):
Ok, I was able to access the session factory with
var sessionFactory = URLSessionFactory.default. I have not been able to get a self-signed SSL cert to work, even with implementing a URLSessionDelegate. But I think we're gonna try to get a verified certificate for dev anyways as that's a better way to work and Apple will require it in the end.Keep up the good work!