Skip to content

Commit

Permalink
Changed to static property
Browse files Browse the repository at this point in the history
  • Loading branch information
buzunboy committed Jul 19, 2021
1 parent a91387f commit f8e0008
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/UsefulNetworkLayer/NetworkLayer/NetworkLayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public class NetworkLayer: NSObject, URLSessionDataDelegate {
/// If `true`, Network Layer will accept challenges, otherwise it will cancel authentication challenges.
///
/// Defaults to `true`.
public var allowInvalidCertificates: Bool = true
static public var allowInvalidCertificates: Bool = true

/// Private initializer
private override init() {
Expand Down Expand Up @@ -356,7 +356,7 @@ public class NetworkLayer: NSObject, URLSessionDataDelegate {
completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
var disposition = URLSession.AuthChallengeDisposition.performDefaultHandling
var credentials: URLCredential? = nil
if allowInvalidCertificates {
if NetworkLayer.allowInvalidCertificates {
if let trust = challenge.protectionSpace.serverTrust {
credentials = URLCredential(trust: trust)
}
Expand Down

0 comments on commit f8e0008

Please sign in to comment.