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

Change the CN of the server certificate #65

Closed
wants to merge 1 commit into from
Closed
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
9 changes: 7 additions & 2 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
# [*email*]
# String. Email address to be used for the SSL certificate
#
# [*common_name*]
# String. Common name to be used for the SSL certificate
# Default: server
#
# [*compression*]
# String. Which compression algorithim to use
# Default: comp-lzo
Expand Down Expand Up @@ -232,6 +236,7 @@
$city,
$organization,
$email,
$common_name = 'server',
$compression = 'comp-lzo',
$dev = 'tun0',
$user = 'nobody',
Expand Down Expand Up @@ -354,9 +359,9 @@
File["/etc/openvpn/${name}/easy-rsa/openssl.cnf"] ];

"generate server cert ${name}":
command => '. ./vars && ./pkitool --server server',
command => ". ./vars && ./pkitool --server ${common_name}",
cwd => "/etc/openvpn/${name}/easy-rsa",
creates => "/etc/openvpn/${name}/easy-rsa/keys/server.key",
creates => "/etc/openvpn/${name}/easy-rsa/keys/${common_name}.key",
provider => 'shell',
require => Exec["initca ${name}"];
}
Expand Down
4 changes: 2 additions & 2 deletions templates/server.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
mode server
client-config-dir /etc/openvpn/<%= scope.lookupvar('name') %>/client-configs
ca /etc/openvpn/<%= scope.lookupvar('name') %>/keys/ca.crt
cert /etc/openvpn/<%= scope.lookupvar('name') %>/keys/server.crt
key /etc/openvpn/<%= scope.lookupvar('name') %>/keys/server.key
cert /etc/openvpn/<%= scope.lookupvar('name') %>/keys/<%= scope.lookupvar('common_name') %>.crt
key /etc/openvpn/<%= scope.lookupvar('name') %>/keys/<%= scope.lookupvar('common_name') %>.key
dh /etc/openvpn/<%= scope.lookupvar('name') %>/keys/dh<%= scope.lookupvar('ssl_key_size') %>.pem
crl-verify /etc/openvpn/<%= scope.lookupvar('name') %>/crl.pem
<% if scope.lookupvar('proto') == 'tcp' -%>
Expand Down