Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sstp: T4393: Add support to configure host-name (SNI) (backport #3436) #3438

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions data/templates/accel-ppp/sstp.config.j2
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ accept=ssl
ssl-ca-file=/run/accel-pppd/sstp-ca.pem
ssl-pemfile=/run/accel-pppd/sstp-cert.pem
ssl-keyfile=/run/accel-pppd/sstp-cert.key
{% if host_name is vyos_defined %}
host-name={{ host_name }}
{% endif %}
{% if default_pool is vyos_defined %}
ip-pool={{ default_pool }}
{% endif %}
Expand Down
9 changes: 9 additions & 0 deletions interface-definitions/vpn_sstp.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@
#include <include/accel-ppp/wins-server.xml.i>
#include <include/generic-description.xml.i>
#include <include/name-server-ipv4-ipv6.xml.i>
<leafNode name="host-name">
<properties>
<help>Only allow connection to specified host with the same TLS SNI</help>
<constraint>
#include <include/constraint/host-name.xml.i>
</constraint>
<constraintErrorMessage>Host-name must be alphanumeric and can contain hyphens</constraintErrorMessage>
</properties>
</leafNode>
</children>
</node>
</children>
Expand Down
10 changes: 10 additions & 0 deletions smoketest/scripts/cli/test_vpn_sstp.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ def test_accel_local_authentication(self):
config = read_file(self._config_file)
self.assertIn(f'port={port}', config)

def test_sstp_host_name(self):
host_name = 'test.vyos.io'
self.set(['host-name', host_name])

self.basic_config()
self.cli_commit()

config = read_file(self._config_file)
self.assertIn(f'host-name={host_name}', config)


if __name__ == '__main__':
unittest.main(verbosity=2)
Loading