title: AlamoFire: public key pinning not working
body: <p>I am creating a Session manager using a shared instance as below:</p>
  
  <pre><code>class Session {
  static let sharedInstance = Session()
  
  private var manager : SessionManager?
  
  func ApiManager()-&gt;SessionManager{
      if let m = self.manager{
          return m
      }else{
  
          let serverTrustPolicies: [String: ServerTrustPolicy] = [
              "https:api-cat.example.com": .pinPublicKeys(
                  publicKeys:savePublicKeys(),
                  validateCertificateChain:true,
                  validateHost:true
              )]
          self.manager = SessionManager(
              serverTrustPolicyManager: ServerTrustPolicyManager(policies: serverTrustPolicies))
          return self.manager!
      }
  }}
  </code></pre>
  
  <p>where <code>savePublicKeys</code> returns <code>[SecKey]</code>.</p>
  
  <p>Even after setting the new ServerTrustPolicy with an empty public key array, I am still able to make successful calls and get data.
  Any ideas if I am making any mistake here?</p>