Making a HTTPS request using Android Volley

后端 未结 10 1709
庸人自扰
庸人自扰 2020-11-28 19:34

I am trying to make a https request using this code:

RequestQueue queue = Volley.newRequestQueue(getApplicationContext());
request = new Request

        
相关标签:
10条回答
  • 2020-11-28 19:57

    If anyone is using nginx and SSL certificates from letsencrypt, the solution is to simply use the certificate from file fullchain.pem instead of cert.pem:

    ssl_certificate     /.../fullchain.pem;
    

    This file includes the concatenation of your certificate and the CA's.

    0 讨论(0)
  • 2020-11-28 20:00

    you can add this class and execut it from onCreate method

    new NukeSSLCerts().nuke();
    

    it will make volley to Trust all SSL certificates.

    0 讨论(0)
  • 2020-11-28 20:01

    got this error when i turned off proxy from cloudflare check image here the best solution for this problem is you can turn on proxy back and also add a full secure access on ssl certificate.

    0 讨论(0)
  • 2020-11-28 20:05

    I couldn't open the link provided by @Ogre_BGR,but while browsing the net I found the actual implementation done in following smanikandan14 Github.Look upon his SSl-connection explanation to understand more about it.

    0 讨论(0)
  • 2020-11-28 20:05

    For anyone who will come up against a problem like this and you use Letsencrypt for your SSL and node.js for webserver, try this. Assuming you have something like this. I fixed this by adding the line const chain = fs... Hope this helps

    ...
    const app = express();
    const privateKey  = fs.readFileSync('ssl/privkey.pem', 'utf8');
    const certificate = fs.readFileSync('ssl/cert.pem', 'utf8');
    const chain = fs.readFileSync('ssl/chain.pem', 'utf8');
    const credentials = {key: privateKey, cert: certificate, ca: chain};
    ...
    var httpsServer = https.createServer(credentials, app);
    
    0 讨论(0)
  • 2020-11-28 20:08

    This can happen for several reasons, including:

    • The CA that issued the server certificate was unknown
    • The server certificate wasn't signed by a CA, but was self signed
    • The server configuration is missing an intermediate CA

    Official doc from android

    Solution: you can provide a certificate file within the request

    0 讨论(0)
提交回复
热议问题