-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a flag to disable checking the ssl certificate #51
Added a flag to disable checking the ssl certificate #51
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This works as expected.
Comments inline. Can you also add docs in
@@ -129,6 +129,8 @@ public struct XCRemoteCacheConfig: Encodable { | |||
/// `/CoolLibrary/main.swift`will be represented as `$(COOL_LIBRARY)/main.swift`). | |||
/// Warning: remapping order is not-deterministic so avoid remappings with multiple matchings. | |||
var outOfBandMappings: [String: String] = [:] | |||
/// Option to enable/disable TrustManager | |||
var certificateVerification: Bool = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked on other tools and found that many of them use a negation of that Bool. Examples:
- Chrome:
--ignore-certificate-errors
- git:
GIT_SSL_NO_VERIFY
- wget:
--no-check-certificate
Maybe we can have something like:
var certificateVerification: Bool = true | |
var disableCertificateVerification: Bool = false |
@@ -129,6 +129,8 @@ public struct XCRemoteCacheConfig: Encodable { | |||
/// `/CoolLibrary/main.swift`will be represented as `$(COOL_LIBRARY)/main.swift`). | |||
/// Warning: remapping order is not-deterministic so avoid remappings with multiple matchings. | |||
var outOfBandMappings: [String: String] = [:] | |||
/// Option to enable/disable TrustManager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TrustManager
might be a big obscure for not advanced user. How about:
/// Option to enable/disable TrustManager | |
/// If true, SSL certificate validation is disabled |
@@ -0,0 +1,17 @@ | |||
// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a licence comment
|
||
final class IgnoringCertificatesTrustManager: NSObject, URLSessionDelegate { | ||
func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { | ||
guard let serverTrust = challenge.protectionSpace.serverTrust else { return } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to call completionHandler
anyway in an else
Thanks! |
No description provided.