title: Can't estabilish connection in TCP port from external host
body: <p>Please, someone help me with this! I'am really struggling for hours by now. Don't know what to do anymore, searched every page everywhere, still no solution.</p>
  
  <p>I have a Python script which listens on port 443 (https - TCP). It receives JSON POST messages by this port. The problem is that it's not receiving anything from external hosts, only from itself. I mean, when I simulate a POST using POSTMAN from an external host, it never answers: </p>
  
  <p>(I masked my server IP with 'y.y.y.y' and a token from my script with 'xxxx')</p>
  
  <p><a href="https://i.stack.imgur.com/IqpoL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IqpoL.png" alt="didnt receive"></a></p>
  
  <p>But when I send the exactly same thing from inside my own server, it works perfectly. The code to send from inside my own server:</p>
  
  <pre><code>[root@rrpump bot]# curl -v -k -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache"  -d '{
  &gt; "update_id":10000,
  &gt; "message":{
  &gt;   "date":1441645532,
  &gt;   "chat":{
  &gt;      "last_name":"Test Lastname",
  &gt;      "id":1111111,
  &gt;      "type": "private",
  &gt;      "first_name":"Test Firstname",
  &gt;      "username":"Testusername"
  &gt;   },
  &gt;   "message_id":1365,
  &gt;   "from":{
  &gt;      "last_name":"Test Lastname",
  &gt;      "id":1111111,
  &gt;      "first_name":"Test Firstname",
  &gt;      "username":"Testusername"
  &gt;   },
  &gt;   "text":"/start"
  &gt; }
  &gt; }' "https://y.y.y.y/xxxx"
  </code></pre>
  
  <p>The successfull response:</p>
  
  <pre><code>* About to connect() to y.y.y.y port 443 (#0)
  *   Trying y.y.y.y...
  * Connected to y.y.y.y (y.y.y.y) port 443 (#0)
  * Initializing NSS with certpath: sql:/etc/pki/nssdb
  * skipping SSL peer certificate verification
  * SSL connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
  * Server certificate:
  *       subject: CN=y.y.y.y 1,O=Example Brooklyn Company,L=Brooklyn,ST=New York,C=US
  *       start date: Mar 06 13:54:03 2018 GMT
  *       expire date: Mar 06 13:54:03 2019 GMT
  *       common name: y.y.y.y
  *       issuer: CN=y.y.y.y,O=Example Brooklyn Company,L=Brooklyn,ST=New York,C=US
  &gt; POST /xxxx HTTP/1.1
  &gt; User-Agent: curl/7.29.0
  &gt; Host: y.y.y.y
  &gt; Accept: */*
  &gt; Content-Type: application/json
  &gt; Cache-Control: no-cache
  &gt; Content-Length: 392
  &gt;
  * upload completely sent off: 392 out of 392 bytes
  * HTTP 1.0, assume close after body
  &lt; HTTP/1.0 200 OK
  &lt; Server: WebhookHandler/1.0 Python/3.6.4
  &lt; Date: Tue, 06 Mar 2018 16:52:55 GMT
  &lt;
  * Closing connection 0
  </code></pre>
  
  <p>Already checked if it is trully listening in that port:</p>
  
  <pre><code>[root@rrpump bot]# lsof -i:443
  COMMAND     PID USER   FD   TYPE     DEVICE SIZE/OFF NODE NAME
  python3.6 30644 root    8u  IPv4 2785755157      0t0  TCP *:https (LISTEN)
  </code></pre>
  
  <p>Already checked the iptables as well (last 'ACCEPT' line):</p>
  
  <pre><code>[root@rrpump bot]# iptables --list
  Chain INPUT (policy ACCEPT)
  target     prot opt source               destination
  ACCEPT     all  --  anywhere             anywhere             state RELATED,ESTABLISHED
  ACCEPT     icmp --  anywhere             anywhere
  ACCEPT     all  --  anywhere             anywhere
  ACCEPT     tcp  --  anywhere             anywhere             state NEW tcp dpt:ssh
  REJECT     all  --  anywhere             anywhere             reject-with icmp-host-prohibited
             all  --  anywhere             anywhere
             tcp  --  anywhere             anywhere
             tcp  --  anywhere             anywhere             tcp dpt:pcsync-https
  ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:pcsync-https
  ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:https
  
  Chain FORWARD (policy ACCEPT)
  target     prot opt source               destination
  REJECT     all  --  anywhere             anywhere             reject-with icmp-host-prohibited
  
  Chain OUTPUT (policy ACCEPT)
  target     prot opt source               destination
  </code></pre>
  
  <p><strong>Firewall is also disabled:</strong></p>
  
  <pre><code>[root@rrpump bot]# firewall-cmd --permanent --add-port=443/tcp
  FirewallD is not running
  </code></pre>
  
  <p>I'am running it on CENTOS 7 64bits, US hostinger VPS server. What am I forgetting to check here??!</p>