alibaba / alibaba/anyproxy

HTTPS requests dont work

Open
#440 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.9k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

When curling the url it works, so this has to be an issue either with a certificate that was generated or with anyproxy. Also, the certificate could not be read in android.

Rule:
```
"use strict";
const path = require("path");
const fetch = require("node-fetch");

module.exports = {
summary: "a rule to hack response",
*beforeSendResponse (requestDetail, responseDetail) { //eslint-disable-line

// OR Fetch from other request
if (requestDetail.url === "https://apiqa.com/config/config") {
return fetch("https://apiqa.com/config");
}
}
};

```
```
[AnyProxy ERROR][2018-11-20 15:09:45]: Send final response failed:Cannot read property 'header' of undefined
```

Response:
```

Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]:
{ body:
Gunzip {
_readableState: [Object],
readable: true,
domain: null,
_events: [Object],
_eventsCount: 7,
_maxListeners: undefined,
_writableState: [Object],
writable: false,
allowHalfOpen: true,
_transformState: [Object],
bytesRead: 0,
_opts: [Object],
_chunkSize: 16384,
_flushFlag: 2,
_finishFlushFlag: 2,
_scheduledFlushFlag: 0,
_handle: [Object],
_hadError: false,
_buffer: ,
_offset: 0,
_level: -1,
_strategy: 0 },
disturbed: false,
error: null },
[Symbol(Response internals)]:
{ url: 'https://apiqa.vungle.com/api/v5/config',
status: 500,
statusText: 'Internal Server Error',
headers: Headers { [Symbol(map)]: [Object] } } }
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the provided beforeSendResponse rule and compare the curl result with the HTTPS request through AnyProxy. Trace the certificate handling and the path that produces “Cannot read property 'header' of undefined”; done means the request completes without that error and the certificate can be read in Android.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.