diff --git a/NEWS b/NEWS index 9d6b29d7..d3c56510 100644 --- a/NEWS +++ b/NEWS @@ -4,7 +4,7 @@ by sskaje). - fixed an infinite loop when asking for group if the default group is selected. -- Added the unix-conn-file configuration option. That allows obtaining +- Added the listen-file configuration option. That allows obtaining plaintext HTTP sessions through a unix domain socket. That is useful when combined with a forwarder HTTPS server like nginx, nxweb or haproxy. - Added the certificate[optional] auth configuration option. That option diff --git a/doc/sample.config b/doc/sample.config index a232fd1b..138098e1 100644 --- a/doc/sample.config +++ b/doc/sample.config @@ -29,10 +29,6 @@ session-control = true # A banner to be displayed on clients #banner = "Welcome" -# Use listen-host to limit to specific IPs or to the IPs of a provided -# hostname. -#listen-host = [IP|HOSTNAME] - # Limit the number of clients. Unset or set to zero for unlimited. #max-clients = 1024 max-clients = 16 @@ -45,13 +41,17 @@ max-clients = 16 # multiple times). Unset or set to zero for unlimited. max-same-clients = 2 +# Use listen-host to limit to specific IPs or to the IPs of a provided +# hostname. +#listen-host = [IP|HOSTNAME] + # TCP and UDP port number tcp-port = 443 udp-port = 443 # Accept connections using a socket file. The connections are # forwarded without SSL/TLS. -unix-conn-file = /var/run/ocserv-conn.socket +listen-file = /var/run/ocserv-conn.socket # Keepalive in seconds keepalive = 32400 diff --git a/src/config.c b/src/config.c index cdb72c37..3479a498 100644 --- a/src/config.c +++ b/src/config.c @@ -82,7 +82,7 @@ static struct cfg_options available_options[] = { { .name = "disconnect-script", .type = OPTION_STRING, .mandatory = 0 }, { .name = "pid-file", .type = OPTION_STRING, .mandatory = 0 }, { .name = "socket-file", .type = OPTION_STRING, .mandatory = 1 }, - { .name = "unix-conn-file", .type = OPTION_STRING, .mandatory = 0 }, + { .name = "listen-file", .type = OPTION_STRING, .mandatory = 0 }, { .name = "occtl-socket-file", .type = OPTION_STRING, .mandatory = 0 }, { .name = "banner", .type = OPTION_STRING, .mandatory = 0 }, { .name = "use-seccomp", .type = OPTION_BOOLEAN, .mandatory = 0 }, @@ -439,9 +439,9 @@ unsigned force_cert_auth; if (reload == 0 && pid_file[0] == 0) READ_STATIC_STRING("pid-file", pid_file); - READ_STRING("unix-conn-file", config->unix_conn_file); + READ_STRING("listen-file", config->unix_conn_file); if (config->unix_conn_file != NULL && (config->auth_types & AUTH_TYPE_CERTIFICATE)) { - fprintf(stderr, "The option 'unix-conn-file' cannot be combined with 'auth=certificate'\n"); + fprintf(stderr, "The option 'listen-file' cannot be combined with 'auth=certificate'\n"); exit(1); } diff --git a/src/ocserv-args.def b/src/ocserv-args.def index bdabf9f0..cf7ac938 100644 --- a/src/ocserv-args.def +++ b/src/ocserv-args.def @@ -110,10 +110,6 @@ An example configuration file follows. # A banner to be displayed on clients #banner = "Welcome" -# Use listen-host to limit to specific IPs or to the IPs of a provided -# hostname. -#listen-host = [IP|HOSTNAME] - # Limit the number of clients. Unset or set to zero for unlimited. #max-clients = 1024 max-clients = 16 @@ -126,15 +122,19 @@ max-clients = 16 # multiple times). Unset or set to zero for unlimited. max-same-clients = 2 +# Use listen-host to limit to specific IPs or to the IPs of a provided +# hostname. +#listen-host = [IP|HOSTNAME] + # TCP and UDP port number tcp-port = 3333 udp-port = 3333 # Accept connections using a socket file. It accepts HTTP -# connections (i.e., without SSL/TLS), and uses it as -# the primary channel. That option cannot be combined with -# certificate authentication. -#unix-conn-file = /var/run/ocserv-conn.socket +# connections (i.e., without SSL/TLS unlike its TCP counterpart), +# and uses it as the primary channel. That option cannot be +# combined with certificate authentication. +#listen-file = /var/run/ocserv-conn.socket # Keepalive in seconds keepalive = 32400 diff --git a/tests/docker-ocserv/ocserv-unix.conf b/tests/docker-ocserv/ocserv-unix.conf index 6935b2f5..409df240 100644 --- a/tests/docker-ocserv/ocserv-unix.conf +++ b/tests/docker-ocserv/ocserv-unix.conf @@ -45,7 +45,7 @@ udp-port = 6551 # Accept connections using a socket file. The connections are # forwarded without SSL/TLS. -unix-conn-file = /var/run/ocserv-conn.socket +listen-file = /var/run/ocserv-conn.socket # Keepalive in seconds keepalive = 32400