Stunnel on 3 servers - stunnel

How can I use stunnel like this :
Client stunnel ===> server 1 stunnel ===> server 2 stunnel
I used :
Client stunnel ===> server stunnel
It works fine, But i don't know how can I use :
Client stunnel ===> server 1 stunnel ===> server 2 stunnel
Is it possible?
Thanks.

Related

Memcached: cannot connect to server with libmemcached but telnet works

I have a program that is using libmemcached client in c. When working with localhost (server on same machine than client) everything works fine. When trying to run the server and client on different machines, the client cannot connect to it. I get the error message: "SERVER HAS FAILED AND IS DISABLED UNTIL TIMED RETRY".
However, when connecting through telnet (telnet ip port) the client machine can connect to the server (even when they are not the same machine). Both machines are on the same network so I am using interface eth0. Pinging works fine.

Tomcat port 80 doesn't work

Using Eclipse, I set up Tomcat Server 7 but seems another application is using the port 80? I got this message from the Tomcat Server:
Port 80 required by Tomcat v7.0 Server at localhost is already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s)
How do I close anything on the port 80 on Mac OS X ?
You could use lsof -p :80 to know which process is running in port 80. Probably it is Apache. kill -9 pid listed.
EX:
sudo kill -9 `lsof -t -i:80`
Port 80 is for http right? Tomcat's default is 8080. If there is something on a mac running on 80 it would be apache. Do you have personal websharing turned on? Would probably be better to use 8080.

Port 25 / 26 says "Could not open connection" using Telnet

I am currently troubleshooting an email problem with my server (IIS 7,5 , Windows server 2008 R2). When I run the "Telnet" command, I get the "Connecting to 127.0.0.1... Could not open the connection to the host, on port 25".
I've been running the commands:
"telnet 127.0.0.1 25"
"telnet 127.0.0.1 26"
"telnet localhost 25"
"telnet localhost 26"
All of these return the same message. If I run at port 80, I get a response.
I tried to turn off my firewall, which made no changes to the behavior (still could not open...).
Is this the usual behavior? Should sending emails still work, or are there something wrong?
Port 25 is for an MTA (message transfer agent) which passes email along as it goes from sender to recipient. If you don't have one installed and running locally then there is nothing listening on that local port. That sounds like the case.
Sending email is an outgoing connection (using some random local port) that can be done by connecting to an MTA on any machine accessible via the network; it doesn't have to use one on the local machine.

Establish a TCP Socket connection using an intermediate host

I need to establish a Socket connection (TCP) between two hosts (say host1 and host2) in Java. But looks like I can't do that because of a firewall. Though there's a third host (say host3) which is accessible from both host1 and host2 and I think can be used as an intermediate for this connection.
So basically, I want to send a request from host1 (client) to host3, which redirects my request to host2 (server).
Could you please let me know how can this be achieved?
Thanks in advance!
You could establish a SSH tunnel with
ssh host3 -L4321:host2:6523
and then connect from host1 to host3 on port 4321. This effectively gets redirected to port 6523 on host2.
A similiar option could be to have ssh provide a SOCKS server.
ssh host3 -D 6543
and then use curl instead of wget.
Then you can do
curl http://host2/foo/bar --socks4 localhost:6543
(untested, --socks4a and --socks5 could be an option as well...)
This ssh command creates a SOCKS server locally which tunnels the connection attempts to the ssh server, which in turn executes them.

RMI Connection refused

When I started RMI service and then I tried to connect to it and then an exception happened, which says "connection refused", but I try to telnet to RMI service what can establish the connection. My RMI server running on a Linux machine and client server is a web server.
That sounds like if your RMI-Registry is not running. Usually u can test this if you lookup netstat outputs.
In Linux:
rmiregistry &
You can also test if it is present with
ps aux | grep rmiregistry
Connection refused to what? If it was 127.0.0.1 and you were expecting a remote address, see item A.1 of the RMI FAQ.