Skip to content
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

Merged
merged 3 commits into from
Jan 16, 2022

Conversation

alekzernov
Copy link

No description provided.

Copy link
Collaborator

@polac24 polac24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -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
Copy link
Collaborator

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:

Suggested change
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
Copy link
Collaborator

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:

Suggested change
/// Option to enable/disable TrustManager
/// If true, SSL certificate validation is disabled

@@ -0,0 +1,17 @@
//
Copy link
Collaborator

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 }
Copy link
Collaborator

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

@polac24 polac24 merged commit 46debcf into spotify:master Jan 16, 2022
@polac24
Copy link
Collaborator

polac24 commented Jan 16, 2022

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants