Signalr connection forcefully close when sending request to aws elastic beanstalk - asp.net-mvc

At beginning of project I use http for connecting with ec2 directly with ip address not domain name and its connects fine and worked fine to my c# client and web client that connected to ec2 through ip adderess.
Recently I added Https to my load balancer and configured all ec2 with https security groups and there trouble started.
Signalr web client with https and ip address connects fine on ec2 but c# client with https and ip address not connecting. C# client throw connection close method continuously.
To solve that I change my connection url from ip to elastic beanstalk domain name to c# client and signalr connected but following things happen.
1) First time when I connect with beanstalk domain name, it response with 400 header error on connection establishment and serve also reply data from database so first time connection established.
2) After server's reply I invoke another method of server at that time error occurred stated that connection disconnected please start connection before making request to server.
3) In signalr there is a connection close method that invoke if connection has been close and it is not invoking.
4) I have searched my query in Internet and found that we have to configured socket connection on beanstalk as they have same issue with nginx. I am using IIS and there is no particular answer for that.
5) I have try to connect directly on ec2 instance domain name but signalr did not established connection and directly fire connection close method without any error or warning.
6) In my network configuration I have enabled inbound port with 443 and 80. If i made request from my browser to that domain url of beanstalk or ec2 its works fine
If you have any idea to configure socket on aws ec2 or elastic beanstalk might help to solve this problem.

Related

Port forwarding, DMZ, turning off firewall and adding port doesn't work to reach out port

I am using Windows 10 with IIS 10.0
I am publishing website on IIS and I need to reach it with public ip.
What I did;
* Port forwarding through router
* Adding DMZ with my local IP
* Turning off firewall
* Adding port to firewall inbound rules with allow edge traversal
I can connect with internal IP like 192.168.1.75:81
I get "System.Net.Sockets.SocketException A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond from [MYPUBLICIP]" when I try to reach it like MYPUBLICIP:81
What are the possible scenarios that blocks to port?
Thanks.
As far as I know, the error message means there is no server listening at specified ip/port that you are trying to connect to.
In my opinion, you should firstly make sure your client machine could access your server by using this MYPUBLICIP address.
Then I suggest you could try to make sure the port 81 is your IIS web application port.
Besides, I suggest you could try to open your event viewer to find out the details error message.

Using data flow with https on cloud foundry

I am trying to deploy a data flow server on Cloud foundry and create a simple app.
Only https end point could be exposed. I cannot enable https using this :
http://docs.spring.io/spring-cloud-dataflow/docs/current-SNAPSHOT/reference/htmlsingle/#configuration-security-enabling-https
As ssl is managed by cf. How do I make data flow server using https?
I have this error:
dataflow:>app list
Command failed org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://dataflow-server.run.aws-usw02-pr.ice.predix.io/apps": Connect to dataflow-server.run.aws-usw02-pr.ice.predix.io:80 [dataflow-server.run.aws-usw02-pr.ice.predix.io/54.201.89.124, dataflow-server.run.aws-usw02-pr.ice.predix.io/52.88.128.224] failed: Connection refused (Connection refused); nested exception is org.apache.http.conn.HttpHostConnectException: Connect to dataflow-server.run.aws-usw02-pr.ice.predix.io:80 [dataflow-server.run.aws-usw02-pr.ice.predix.io/54.201.89.124, dataflow-server.run.aws-usw02-pr.ice.predix.io/52.88.128.224] failed: Connection refused (Connection refused)
Thanks in advance.
Best Regards
as you already mentioned, you can not enable https at the container level inside cloudfoundry today. The traffic between the router and diego cell is not encrypted (unless you are using IPSEC).
So your dataflow server would not be configured with https, just deploy the server as it is. You should rely on your cloudfoundry install to have an open port at 443 on it's loadbalancer that forwards traffic to the router. Later CF incarnations support certificate placement at the router level.
Now, at the client (dataflow-shell) if you are using a valid certificate you don't need to do anything, but if you have a selfsigned certificate, you need to tell it to accept self-signed certificates, or skip validation all together.

AWS Opsworks: Load balancing via https

I've setup 2 Rails server instances with an Elastic Load Balancer. I setup SSL via opsworks and when I hit the IP of my instances with https e.g. https://1.2.3.4 I can see the correct certificate.
However, when I hit the domain of the Elastic Load Balancer, a timeout is thrown (loads endlessly).
How should I setup ELB, to properly redirect with https to my instances?
Found the answer was in Security Groups. Besides setting all inbound connections to accept HTTPS protocol and port 443, you have to set the outbound connections of the ELB. I found out that they were only to HTTP, and trying to access the instances with HTTPS it failed. I setup a new outbound rule HTTPS to anywhere and it worked!

Can't Access Rails Server on EC2 Instance from Public IP

I have rails running on an Amazon EC2 instance but I'm having trouble accessing my rails server (port 3000) from public IPs. This was working as recently as last week but today when I started up my rails server I was unable to get a response from an outside IP. Even when I created a brand new rails project I was not able to access the server once I had started it.
Despite this I can access the Apache server by going through port 80. Moreover SSL continues to work.
I have already
ensured that the port 3000 is open on my security group in the Amazon EC2 console
checked my iptables on the Amazon instance. There are no rules and the default for the INPUT chain is to accept packets.
banged my head against a wall.
Does anyone have any ideas?
Did you verify the port 3000 is opened for every IPs addresses and not only for your workplace's IP?
Also, your Amazon EC2 virtual machine's IP could have changed.

Connection refused on client and server, both are on MAC

I am using Mac book and having client and server running on same machine. Server opens socket whenever it has to send command to Client. Problem is Client opens socket at startup but whenever server opens on . Ip adress is different. I would like to know if i create tunnel between these 2 sockets. Right now, while in server i am getting "Connection refused" error.
Any help is appreciated.
Thanks
Just use 127.0.0.1 loopback address for testing your initial socket code. Server bind()s and listen()s on some known port, client connect()s to it. Once you figure out that setup you can move on to routing between real addresses.

Resources