One machine being server AND client with STunnel
Asked Answered
C

4

6

I know that STunnel can be set up as either server or client with the "client = no" or "client = yes" lines in the config file. Is there a way for a machine to be BOTH a server and client?

Countercurrent answered 5/2, 2011 at 23:37 Comment(0)
I
5

It is much easier you can simply You just have to set client=no under the [] (service) where stunnel works as a server and client=yes otherwise. You should also put service specific parameters like certificates where they belong.

Something like:

[server1]
..
client=no

[client1]
..
client=yes
Intercom answered 7/10, 2014 at 20:13 Comment(1)
but make sure your client and server should not accept on same port number.Cleodell
R
1

You can specify the configuration file path on the command line, see stunnel(8).

Rademacher answered 5/2, 2011 at 23:44 Comment(1)
Does this mean I would need to start 2 STunnel services with 2 configuration files?Countercurrent
W
0

As /etc/stunnel/README file says,

"Files found under the /etc/stunnel directory that end with .conf are used by stunnel4 service as configuration files, and each will be used to start a daemon process setting up a tunnel with the given configuration..."

I assume you can keep 2 separate config files there: one for server and another one for client. Than you'll have 2 daemons started. You can find config file examples in a file /usr/share/doc/stunnel4/examples/stunnel.conf-sample

Wreathe answered 2/2, 2016 at 9:59 Comment(0)
L
0

Stunnel Client Configurations

[client]
client = yes
accept = 7777
connect = 127.0.0.1:7777

"accept" will act as server
"connect" will act as client

Stunnel Server Configurations

[server]
accept = 7777
connect = 127.0.0.1:7777

"accept" will act as client
"connect" will act as server

Lecher answered 18/4, 2021 at 16:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.