Cross Domain Requests in Internet Explorer: Preflight not being sent

I have come across several similar discussions but none of the solutions provided have worked for me so far.

Issue:

In our current setup, we have three servers hosting our http-apis - two for testing and one for production.

Lately, we have been deploying client-side web applications using AngularJS. As these client apps are meant for our customers, the communication with our API is cross-domain. The web apps function correctly in Chrome, Safari, and Firefox with all APIs. However, when it comes to the third API, Internet Explorer (11) fails to send the preflight (options) request, which prevents the client from communicating with the API. Interestingly, the web app works fine in IE for the other two APIs.

The APIs in question are as follows:

https://api.doma.in/accesstoken -- Works in IE11
https://api2.doma.in/accesstoken -- Works in IE11
https://api3.doma.in/accesstoken -- Does not send preflight in IE11.

It's worth noting that the three servers are almost identical in setup, so there shouldn't be much difference.

However, the error messages I am encountering are as follows:

SEC7118: XMLHttpRequest https://api3.doma.in/accesstoken required CORS (Cross Origin Resource Sharing).
SEC7119: XMLHttpRequest https://api3.doma.in/accesstoken required CORS Preflight.
SCRIPT7002: XMLHttpRequest Network error 0x80070005, Access Denied.

In the network log, it only shows that the preflight request was canceled, resulting in no request or response headers being sent.

Answer №1

Upon utilizing openssl, I successfully pinpointed the issue. Running

$ openssl s_client -connect <url/domain>:443 -state
revealed an SSL error.

The results from openssl for Api 1 and 2 were as follows:

SSL_connect:SSLv3 read server certificate A
SSL_connect:SSLv3 read server key exchange A
SSL_connect:SSLv3 read server done A
SSL_connect:SSLv3 write client key exchange A
SSL_connect:SSLv3 write change cipher spec A
SSL_connect:SSLv3 write finished A
SSL_connect:SSLv3 flush data
SSL_connect:SSLv3 read finished A

However, api 3 (the malfunctioning api-server) displayed two additional operations:

SSL_connect:SSLv3 read server certificate A
SSL_connect:SSLv3 read server key exchange A
SSL_connect:SSLv3 read server certificate request A //This
SSL_connect:SSLv3 read server done A
SSL_connect:SSLv3 write client certificate A //This
SSL_connect:SSLv3 write client key exchange A
SSL_connect:SSLv3 write change cipher spec A
SSL_connect:SSLv3 write finished A
SSL_connect:SSLv3 flush data
SSL_connect:SSLv3 read finished A 

Although the issue has not been resolved on the server yet, I am currently using a temporary workaround solution by implementing xdomain (found at https://github.com/jpillora/xdomain). This "hack" is easy to set up and functions properly.

Answer №2

To provide additional insight into the underlying issue and prevent others from spending countless hours or days investigating.

In my case, I discovered that IE 11 was adhering to the proper specifications by not sending the client certificate during the CORS Preflight request. You can find more information on this here

Interestingly, Chrome and other browsers do send the client certificate despite it being overlooked in the spec.

Within my setup involving Pivotal Cloud Foundry, we had to adjust a configuration setting to prevent the connection from being outright rejected. https://i.stack.imgur.com/CBuN1.png

A quick way to confirm if you're facing a similar issue is to download and set up Fiddler, enable HTTPS support, and test your CORS functionality again, I found that mine functioned correctly with Fiddler but encountered issues when connecting directly to the remote server.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What's causing the error "is not a function" to appear?

I am currently facing an issue while attempting to develop an angular service. Here is the code snippet for the service: var app = angular.module('plunker', []); // Filter Service that returns records with crdamt positive: app.factory('Fil ...

Steps for adding an array of JSON objects into a single JSON object

I have a JSON array that looks like this: var finalResponse2 = [ {Transaction Amount: {type: "number"}}, {UTR number: {type: "string"}} ] My goal is to convert it into the following format: responses : [ { Transaction Amount: {type: "number"}, UTR numbe ...

Creating visually appealing Highcharts.js visualizations for both mobile and desktop devices

Has anyone had success implementing a responsive design with Highcharts to ensure charts look great on both mobile and desktop screens? By default, Highcharts do adjust when resizing the browser window, but sometimes the X-axis can become cluttered by tic ...

Discover the complete guide on incorporating a JavaScript library with additional dependencies in Angular 2

I am a beginner with angular 2 and I am attempting to integrate the Miso Dataset JavaScript library into my angular 2 project. The Miso library requires other JavaScript libraries as dependencies. Although I have included all the necessary JavaScript file ...

Retrieving a variable value from an AJAX call for external use

Looking for a solution to pass the generated JSON response from an ASMX web service accessed via AJAX to an outside variable in another function. Below is the code snippet for reference: function setJsonSer() { var strWsUrl = &apo ...

Proper method for calling a function within a specific scope

I am utilizing user-contributed modules that I aim to avoid editing in order to make upgrades easier. My goal is to enable users to browse for a CSV file on the local filesystem, parse it, and display it in a dynamic table. For this task, I am using PapaP ...

Pattern matching algorithm designed to eliminate background-color attributes

Looking to strip out any "background-color:[whatever];" styles from the text within a div. The plan is to eliminate all inline background-color styles completely. I've been eyeing JavaScript's string.replace(regex,str) as a potential solution ...

Unable to locate the specified environment variable in the current nest

Currently, I am referring to the official documentation on the NestJs website that provides a guide on using config files: https://docs.nestjs.com/techniques/configuration Below is the code snippet I am working with: app.module import { Module } from &ap ...

Unveiling Parameters from a Function Transferred as an Argument to Another Function in JavaScript

I'm just getting started with JavaScript and I've encountered a small program where a function takes another function as an argument. My goal is to figure out how to extract or access the arguments of that passed in function. Here's a specif ...

Retrieve the full directory path that has been chosen in an HTML form

I am facing a similar issue in my web application where I am using PHP, HTML, and JavaScript. What I want is to be able to select a folder and obtain the full path of that folder for backing up data. For example, when a user enters backup.php, they should ...

Using JavaScript to transform base64 encoded strings into images

I'm currently working on an app using Titanium and I have a base64 string that I need to convert into an image from JSON data. Any assistance you can provide would be much appreciated. Thank you! ...

Ways to Press the Enter Key on Different Browsers

Looking for a solution to get the keypress action working properly? I have a chat feature where I need to send messages. Here is what I have in the Form-tag (JSP based): function SendMessage() { if (event.keyCode===13) { ale ...

Send the film to Cloudinary from within an AngularJS single page application running within Electron

Currently, I am facing a challenge in my electron app which is an AngularJS SPA. I want to upload a file from the user's disk to Cloudinary directly from the front-end. In the past, I was successful in uploading photos from AngularJS by selecting the ...

How to retrieve the value of a checkbox in AngularJS instead of getting a boolean value

The following code snippet shows a checkbox with the value "Athlete" and I want to retrieve that value when it is selected. <input type='checkbox' value="Athlete" ng-model="p.selected"> Currently, in the console, p.selected displays true ...

The current error message states that the function is undefined, indicating that the Bookshelf.js model function is not being acknowledged

I have implemented a user registration API endpoint using NodeJS, ExpressJS, and Bookshelf.js. However, I encountered an error while POSTing to the register URL related to one of the functions in the User model. Here is the code snippet from routes/index. ...

The app's connection issue persists as the SDK initialization has exceeded the time limit

We are currently facing an issue when trying to publish a new manifest for our app in the store. The Microsoft team in India is encountering an error message that says "There is a problem reaching the app" during validation. It's worth noting that th ...

Ways to retrieve text from a pdf document using JavaScript?

Is there a way to extract text from a PDF using JavaScript? I've looked into npm modules like PDF-TO-TEXT, but they require a file path name as input. I'm currently using the react-drop-to-upload module to allow users to drop PDF files onto a rea ...

finding the node version in a code repository

Is it possible to determine the targeted node version (4 or 6) of a Node.js application by examining its code? I'm currently reviewing this: https://github.com/jorditost/node-postgres-restapi ...

Having difficulty transitioning a function with a promise from JavaScript to TypeScript

I am currently in the process of transitioning my existing NodeJS JavaScript code to TypeScript for a NodeJS base, which will then be converted back to JavaScript when running on NodeJS. This approach helps me maintain clear types and utilize additional fe ...

The timer will automatically refresh when the page is refreshed

Currently, I am encountering an issue while working on a quiz application in PHP. The problem arises when users start the test and the timer is running correctly. However, when users move to the second question, the timer resets again. Below is the code sn ...