Making a HTTPS request using Android Volley

后端 未结 10 1742
庸人自扰
庸人自扰 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 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);
    

提交回复
热议问题