GithubHelp home page GithubHelp logo

ssl pinning in vox about vox HOT 4 OPEN

ZahraAsgharzadeh avatar ZahraAsgharzadeh commented on May 23, 2024
ssl pinning in vox

from vox.

Comments (4)

ZahraAsgharzadeh avatar ZahraAsgharzadeh commented on May 23, 2024 1

I found out by my self , it's good to support it when you publish a framework ... some body should waste his time to edit library .

from vox.

markturnip avatar markturnip commented on May 23, 2024

I found out by my self , it's good to support it when you publish a framework ... some body should waste his time to edit library .

Perhaps you can provide some example code on your approach?

from vox.

ZahraAsgharzadeh avatar ZahraAsgharzadeh commented on May 23, 2024

I found out by my self , it's good to support it when you publish a framework ... some body should waste his time to edit library .

Perhaps you can provide some example code on your approach?

of course.
I'll put example in next comment 👍

from vox.

ZahraAsgharzadeh avatar ZahraAsgharzadeh commented on May 23, 2024

In your project Go to Pods folder, open Vox.
Open JSONAPIClient_Alamofire.swift which module that all requests handles there .
In function executeRequest(...) add this part of code :

/// Configure the trust policy manager let serverTrustPolicy = ServerTrustPolicy.pinCertificates( certificates: ServerTrustPolicy.certificates(), validateCertificateChain: false, validateHost: true)

let serverTrustPolicies = ["yourhost.com": serverTrustPolicy]
let serverTrustPolicyManager = ServerTrustPolicyManager(policies: serverTrustPolicies)
let url = baseURL.appendingPathComponent(path)
let headers: HTTPHeaders = [ "Content-Type": "application/vnd.api+json", "Accept": "application/vnd.api+json", "Authorization": "token"]

/// using certificate pinning
let sessionManager = SessionManager(configuration: URLSessionConfiguration.default,serverTrustPolicyManager: serverTrustPolicyManager)
let request = multiEncodedURLRequest(url: url, method: method, queryItems: queryItems, bodyParameters: bodyParameters, headers: headers)

And when request sent, in responseData call back do
let _ = sessionManager
base on this link : https://stackoverflow.com/questions/39984880/alamofire-result-failure-error-domain-nsurlerrordomain-code-999-cancelled

from vox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.