Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Iptables confuses me, can someone give me the command to open outgoing ssl connections from the server on port 443?

It's used by a script on the server, currently when I execute it on port 80 it works fine, on port 443 it just hangs so I'm assuming the ports not open for outgoing connections.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Add line in /etc/sysconfig/iptables:

-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 443 -j ACCEPT

And run command:

iptables -A RH-Firewall-1-INPUT -p tcp -m tcp --dport 443 -j ACCEPT
share|improve this answer
    
great thanks for the commands! –  user56572 Oct 8 '10 at 17:30

presumably you have a script running on your own server that is making some connection to 1) a web server remotely, at either http port 80 or https on port 443 or 2) the script is connecting back to a web server running on the local server at port 80 or 443

By the sound of your description, "on port 443 it just hangs" you are able to make a TCP connection to port 443, but somehow the SSL protocol negotiation fails or some other problem occurs.

To test this you can do something like this from the command line;

# telnet www.yourservergoeshere.com 443
Trying 74.125.227.18...
Connected to www.l.google.com.
Escape character is '^]'.

and see whether it actually connects to the remote 443 port. If you get the message

connected to www.someserver.com

then the issue is not your iptables.

If so it is more likely to be what ever is in your script being unable to talk SSL/HTTPS

if the default INPUT rule for your iptables is DROP, then you might get your scripting waiting for the TCP timeout length before failing to connect.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.