Edge Cross Domain Request via HTTPS

I am trying to create an Edge extension that will communicate with a server other than the origin of the web page. However, the message seems to fail.

I read about issues with cross-domain requests when the source is external and the purpose of the cross-domain request is inside the intranet. Therefore, I exposed the intranet server on the Internet. But it did not help.

I tried to fetch as simple as possible () and got this result:

fetch (" https://fake.domain.info/api/browser/authenticate/ "). then ((response) => {console.log (response);}). catch ((error) => {console.log (error);})

[object Promise]: {}

[object Error]: {description: "Failed to get", message: "Fetch failed", number: -2147418113}

I checked the network traffic in the debug window and found a strange entry:

Name Protocol Method Result Content type Initiator of the received time https://fake.domain.info/api/browser/authenticate/ HTTPS GET 200 (from cache) 0 s

I really don't understand why "(from the cache)" appears. So, a verified request using WireShark. I found out the following:

61 3.004629 xxx.xxx.xxx.xxx 192.168.124.144 TLSv1.2 501 Server Hello, Certificate, Exchange server key, Hello Done server

62 3.004666 192.168.124.144 xxx.xxx.xxx.xxx TCP 54 51965 → 443 [ACK] Seq = 207 Ack = 1908 Win = 261632 Len = 0

...

86 3.010645 192.168.124.144 xxx.xxx.xxx.xxx TCP 54 51965 → 443 [FIN, ACK] Seq = 207 Ack = 1908 Win = 261632 Len = 0

87 3.011785 xxx.xxx.xxx.xxx 192.168.124.144 TCP 60 443 → 51965 [ACK] Seq = 1908 Ack = 208 Win = 65536 Len = 0

...

89 3.012215 xxx.xxx.xxx.xxx 192.168.124.144 TCP 60 443 → 51965 [RST, ACK] Seq = 1908 Ack = 208 Win = 0 Len = 0

I do not understand why the connection is reset immediately after TLS acknowledgment. Opening a webpage works great. I checked it with WireShark and found that the first connection closes in the same way right after the TLS handshake, but a new one is created immediately and traffic passes through this one without any problems.

I checked the server side logs - no logging problems. Just like HTTP requests were not logged.

When I tried to execute the same request through plain HTTP, it worked fine:

fetch (" http://fake.domain.info/api/browser/authenticate/ "). then ((response) => {console.log (response);}). catch ((error) => {console.log (error);})

[object Promise]: {}

[object Response]: {body: Object, bodyUsed: false, headers: Object, ok: false, redirected: false ...}

HTTP 404 returns as expected

So, I see that the problem is with the TLS connection.

Another thing: the problem only occurs when doing this in Edge. When you do this in Firefox, it works fine:

fetch (" https://fake.domain.info/api/browser/authenticate/ "). then ((response) => {console.log (response);}). catch ((error) => {console.log (error);})

Promise {: "pending"}

Response {type: "basic", url: " https://fake.domain.info/api/brows ...", redirected: false, status: 404, ok: false, statusText: "[{" errors ": [{"message": "Invalid API ...", headers: Headers, bodyUsed: false}

And I checked the traffic in WireShark when I launched a request from Firefox - the connection after the TLS handshake is not closed, but the application data is sent immediately.

Is this some known Edge behavior, and is there any way to fix it? Maybe this is an incorrect server configuration?

+5
source share

Source: https://habr.com/ru/post/1275296/


All Articles