ngx-admin-bundle-support
ngx-admin-bundle-support copied to clipboard
CORS - SSL Issues and Implementation
Good evening.
We are currently trying to setup everything so that the backend and frontend are not on the same network and so processes the request over HTTPS, however we are having issues trying to implement SSL on the backend.
site: https://enixlabs.uk api: https://enua.me <---- Https isn't working
We've tried various options.
const https = require('https') <-- Added code for https
const fs = require('fs') <-- Added certs
polyfills-es2015.8df41bc2e30885896a47.js:1 Mixed Content: The page at 'https://enixlabs.uk/auth/login' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://enua.me:3001/api/auth/login'. This request has been blocked; the content must be served over HTTPS.
polyfills-es2015.8df41bc2e30885896a47.js:1 POST https://[PUBLICIP]:3001/api/auth/login net::ERR_SSL_PROTOCOL_ERROR
polyfills-es2015.8df41bc2e30885896a47.js:1 POST https://enua.me:3001/api/auth/login net::ERR_SSL_PROTOCOL_ERROR
Are we missing something when it comes to adding SSL, as nothing seems to work.
We also had to update the app.js for CORS
app.all('/', (req, res, next) => {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Headers', 'X-Requested-With');
next();
});
As it wasn't passing the CORS request for authentication, fixed that problem with the above...
This was the issue with CORS before adding in the ACA
I've noticed by taking out the port, the CORS issue presents itself again.
Good evening.
We are currently trying to setup everything so that the backend and frontend are not on the same network and so processes the request over HTTPS, however we are having issues trying to implement SSL on the backend.
site: https://enixlabs.uk api: https://enua.me <---- Https isn't working
We've tried various options.
const https = require('https') <-- Added code for https const fs = require('fs') <-- Added certs
polyfills-es2015.8df41bc2e30885896a47.js:1 Mixed Content: The page at 'https://enixlabs.uk/auth/login' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://enua.me:3001/api/auth/login'. This request has been blocked; the content must be served over HTTPS.
polyfills-es2015.8df41bc2e30885896a47.js:1 POST https://[PUBLICIP]:3001/api/auth/login net::ERR_SSL_PROTOCOL_ERROR
polyfills-es2015.8df41bc2e30885896a47.js:1 POST https://enua.me:3001/api/auth/login net::ERR_SSL_PROTOCOL_ERROR
Are we missing something when it comes to adding SSL, as nothing seems to work.
We also had to update the app.js for CORS
app.all('/', (req, res, next) => { res.header('Access-Control-Allow-Origin', '*'); res.header('Access-Control-Allow-Headers', 'X-Requested-With'); next(); });
As it wasn't passing the CORS request for authentication, fixed that problem with the above...
Did you solve the issue? how?
Thanks
Good evening. We are currently trying to setup everything so that the backend and frontend are not on the same network and so processes the request over HTTPS, however we are having issues trying to implement SSL on the backend. site: https://enixlabs.uk api: https://enua.me <---- Https isn't working We've tried various options.
const https = require('https') <-- Added code for https const fs = require('fs') <-- Added certs
polyfills-es2015.8df41bc2e30885896a47.js:1 Mixed Content: The page at 'https://enixlabs.uk/auth/login' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://enua.me:3001/api/auth/login'. This request has been blocked; the content must be served over HTTPS.
polyfills-es2015.8df41bc2e30885896a47.js:1 POST https://[PUBLICIP]:3001/api/auth/login net::ERR_SSL_PROTOCOL_ERROR
polyfills-es2015.8df41bc2e30885896a47.js:1 POST https://enua.me:3001/api/auth/login net::ERR_SSL_PROTOCOL_ERROR
Are we missing something when it comes to adding SSL, as nothing seems to work. We also had to update the app.js for CORSapp.all('/', (req, res, next) => { res.header('Access-Control-Allow-Origin', '*'); res.header('Access-Control-Allow-Headers', 'X-Requested-With'); next(); });
As it wasn't passing the CORS request for authentication, fixed that problem with the above...
Did you solve the issue? how?
Thanks
Yes in a fashion, we implemented docker into the system and used Nginx to proxy the connection, which gave us full SSL between the two.