简体   繁体   中英

Could not open ssl 443 port server

I have an external server that hosted in dreamcompute Which it is can consider as virtual private server (vps)

I have test out using: https://ping.eu/port-chk/ the results:

xxx.xxx.xxx.xxx:443 port is closed
xxx.xxx.xxx.xxx:80 port is open
xxx.xxx.xxx.xxx:22 port is open

I have check my server port is open in linux:

username@server:~$ sudo ufw status
Status: active

To                         Action      From
--                         ------      ----
80/tcp                     ALLOW       Anywhere
443/tcp                    ALLOW       Anywhere
22/tcp                     ALLOW       Anywhere
3306/tcp                   ALLOW       Anywhere
80/tcp (v6)                ALLOW       Anywhere (v6)
443/tcp (v6)               ALLOW       Anywhere (v6)
22/tcp (v6)                ALLOW       Anywhere (v6)
3306/tcp (v6)              ALLOW       Anywhere (v6)

I'm able to access the web server internally by

http://localhost/
https://example.com/
http://example.com/

which all of them I set an index.php with a code:

<?=phpinfo()?>

From my experience, it was my router firewall problem, but I don't have the control to do it. Maybe it was my dns or something else?

Steps you need to do to check your port: verify that you can connect from your local machine... you can just telnet to port 443, both on localhost (127.0.0.1) as well as on your machine's IP address.(You have already done this what I saw.) You should at least get an answer (ie. verification that there is a listener on that port).

Just for an example:

  $ telnet 127.0.0.1 443
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused

This confirms port is listening

 $ telnet 127.0.0.1 443
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
^]
telnet> quit
Connection closed.

We can also do by checking NETSTAT

  $ netstat -antl | grep 443
tcp        0      0 127.0.0.1:52421         127.0.0.1:443           TIME_WAIT
tcp6       0      0 :::443                  :::*                    LISTEN

For SSL we can use openSSL

    $ openssl s_client -connect 127.0.0.1:443
CONNECTED(00000003)
...

You may have to open and/or forward the address on your router or network firewall.

Hope it works fine,! If not tell us, we will work on more solutions!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM