Skip to content

considerVPNConnectionAsProxy not exposed as public API #156

Description

@alobaili

The readme states that:

System proxy detector module

Now you can also detect if an app is connected to VPN

let amIProxied: Bool = IOSSecuritySuite.amIProxied(considerVPNConnectionAsProxy: true)

However, in version 2.2.0 of this library, the parameter considerVPNConnectionAsProxy is not included in the public function:

  /// This type method is used to determine if  HTTP proxy was set in the iOS Settings.
  ///
  /// Usage example
  /// ```swift
  /// let amIProxied: Bool = IOSSecuritySuite.amIProxied()
  /// ```
  /// - Returns: Bool indicating if the device has a proxy setted (true) or not (false)
  public static func amIProxied() -> Bool {
    return ProxyChecker.amIProxied()
  }

The parameter is only available in the internal ProxyChecker.amIProxied(considerVPNConnectionAsProxy:) with a default value of false:

internal class ProxyChecker {
    static func amIProxied(considerVPNConnectionAsProxy: Bool = false) -> Bool {
        ...
    }
}

Which makes it impossible for consumers to enable treating VPN as proxy.

I suggest one of the options:

  • Update README.md and remove this parameter to make it consistent with the public API
  • Update IOSSecuritySuite.amIProxied() and make it take the parameter considerVPNConnectionAsProxy and pass it to the internal ProxyChecker
  • Provide a new IOSSecuritySuite.amIVPNed() that allows consumers to separately check if the app is connected to a VPN

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions