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

Struggling to make JavaScript read JSON data from an HTML file

I am currently working on developing a word search game using django. One of the tasks I need to accomplish is checking whether the entered word exists in a dictionary. To achieve this, I have been converting a python dictionary into JSON format with json. ...

Submitting form data using Vue and PHPMailer

I've been encountering an issue with submitting a contact form from a page. After submitting the form, nothing seems to happen. My tech stack includes Vue, Axios, and PHPMailer for handling this functionality. Upon inspecting the network tab, it appea ...

Querying the api for data using Angular when paginating the table

Currently, I have a table that retrieves data from an API URL, and the data is paginated by default on the server. My goal is to fetch new data when clicking on pages 2, 3, etc., returning the corresponding page's data from the server. I am using an ...

Actions for HTML form submission to API through proxy link

Currently, the form is functioning properly with this setup <form method="POST" action='http://localhost:3000/newRecord'> However, my goal is to simplify the action attribute to just be action='/newRecord'. In React, I achieve ...

Tips for transferring HTML code to a controller

Currently facing an issue while working with MVC and attempting to store HTML code from a view in a database field. In the JS section of my MVC solution, I have the following code snippet: var data = { id_perizia: $("#id_perizia").val(), pinSessione: $("# ...

Avoid Refreshing the Page When Pressing the Like Button

I've been working on code for liking a post and saving the value to a database using server-side code. However, I'm running into some issues when the page refreshes after clicking the like button. I tried using event.preventDefault() in my JavaSc ...

Applying styled text to a Node.js chat application

I developed a chat application using node.js which allows users to enter a username and send messages. The messages are displayed in a <ul> format showing "username: message". I was looking for a way to make the username appear bold and in blue color ...

Having trouble importing from the public folder in CSS with Create React App?

While working on a project initialized with Create React App, in the public folder there is an assets directory containing a file named logo512.jpg. When I use this file in a component like so: <div> <img src='/assets/logo512.jpg'/& ...

Provide Arguments to a Function in Express JS

How's everything going? I'm curious to find out the best way, and if it's possible to send a specific parameter to an express function in NodeJS. I want to pass the string ('admin') or any other string that I choose to the 'R ...

Is there a way for me to receive numerical values instead of NaN?

I'm currently facing a challenge in creating a Fibonacci number generator and I've hit a roadblock. It seems like I have a solution, but the appearance of NaN's is causing me some trouble. function fibonacciGenerator (n) { var output = [ ...

There appears to be an issue with the error handling function within React

I am facing an issue with my error function while checking the browser error, and I am unsure why adding a console.log with the error is causing trouble. I need some assistance in troubleshooting this problem which seems to be occurring at line 29 of my im ...

What is the best way to align a popup window with the top of the main window?

I have successfully created a simple lightbox feature where a popup window appears when a thumbnail is clicked. My question is, how can I use jQuery to detect the top position so that the popup div always appears around 200px from the top of the window? $ ...

What is the process for configuring SSL certificates for a web server's CNAME using NodeJS and ExpressJS?

After successfully configuring SSL certificates for a NodeJS web server in the setup outlined below, everything is running smoothly: process.env.HTTPS_PORT = 3000; // Listening on HTTPS port 3000. process.env.HTTP_PORT = 6000; // Listening on HTTP ...

Encountering an issue while attempting to replicate the Spotify app on localhost:3000. The error message "TYPEERROR: Cannot read property 'url' of undefined" is hind

As a first-time user of stackoverflow, I am unfamiliar with its rules and regulations, so I apologize in advance for any mistakes I may make. Currently, I am attempting to create a Spotify clone using React. Everything was going smoothly until I completed ...

Issue with CSS: 200vw not scaling correctly for mobile devices

I'm attempting to create a horizontal slide effect between two div elements, so here is the HTML code: <div id="container"> <div class="viewport-1"> <div class="inner-div"> <h1>Viewport background 1</h1></ ...

Storing client time data in a database using Node.js

Just starting out with Node.js so bear with me while I learn the ropes. I successfully set up a basic TCP server using the guide here In my current project, users will connect to the server from a web browser and I'm interested in capturing the TCP ...

Displaying an image gradually as the user moves down the page

Recently, I came across this fascinating website: As you scroll down, the images on the site gradually unveil more details, which caught my attention. This unique effect is not something commonly seen on websites, and I'm curious to learn how it is ...

Looping through JSON objects using for loop

I am trying to implement a for loop with the following json data. The console.log function is working properly, but when I use it in the javascript function, it does not work as expected. I want the for loop to be functional within the javascript function ...

dojo.xhrGet evaluating script tags

I have a piece of code that is similar to the following: var targetElem = dojo.byId('xyz'); var xhrArgs = { url: 'Welcome.do?call=JS', preventCache: true, load: function(data){ targetElem.innerHTML = data; dojo.parser.par ...

Sharing JavaScript code between Maven modules can be achieved by following these steps

My Maven project has a unique structure that includes: "Base" module -- containing shared Java files -- should also include shared JavaScript files Module 1 -- using shared Java files as a Maven dependency -- should utilize shared JavaScript files throug ...