SocketCluster/socketcluster-client

Instance_1 was not allowed to run insecure contenet from instance_2

Closed this issue · 1 comments

I have the follow architecture:

  • EC2_1_INSTANCE which has socketcluster client functionality. It is a web application with nginx listening on port :443.
  • EC2_2_INSTANCE which has socketcluster server functionality ( 2 workers ). Nginx listens on port :80 and splits all traffic between :3000 and :3001.

EC2_1_INSTANCE instance is connecting to EC2_2_INSTANCE instance using the following settings:
options = {
path: '/',
port: 80,
hostname: 'EC2_2_INSTANCE',
autoConnect: true,
secure: false,
};

I am getting this error in browser console:
[blocked] The page at https://EC2_1_INSTANCE was not allowed to run insecure content from ws://EC2_2_INSTANCE:80/

How something like this gets fixed? Do I have to also get a second certificate for EC2_2_INSTANCE? Another domain/subdomain?

I would opt for a subdomain for your workers/sc-server, you can't run a secure http connection over port 80.
Or at least not the current version of http (1.2).
Basically your webapp is secured over SSL on port 443 but then the client creates a connection to port 80 which is not secure, so the browser will refuse to connect to insecure sources within the webapp as it cannot guarantee the sources security.