Skip to content

Commit 9f16e79

Browse files
committed
Bugfix for issue #41 reported by @reamasesa
1 parent d466b39 commit 9f16e79

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

controllers/certificates.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,9 @@ func (c *CertificatesController) saveClientConfig(keysPath string, name string)
251251
cfg.PersistKey = ovClientConfig.PersistKey
252252
cfg.RemoteCertTLS = ovClientConfig.RemoteCertTLS
253253
cfg.RedirectGateway = ovClientConfig.RedirectGateway
254-
// cfg.Proto = ovClientConfig.Proto // this will be set from server config
254+
cfg.Proto = ovClientConfig.Proto // this will be set from client instead of server config
255+
cfg.Auth = ovClientConfig.Auth // this will be set from client instead of server config
256+
cfg.Cipher = ovClientConfig.Cipher // this will be set from client instead of server config
255257
cfg.Device = ovClientConfig.Device
256258
cfg.AuthNoCache = ovClientConfig.AuthNoCache
257259
cfg.TlsClient = ovClientConfig.TlsClient
@@ -288,9 +290,9 @@ func (c *CertificatesController) saveClientConfig(keysPath string, name string)
288290
serverConfig := models.OVConfig{Profile: "default"}
289291
_ = serverConfig.Read("Profile")
290292
cfg.Port = serverConfig.Port
291-
cfg.Proto = serverConfig.Proto
292-
cfg.Auth = serverConfig.Auth
293-
cfg.Cipher = serverConfig.Cipher
293+
// cfg.Proto = serverConfig.Proto //Now getting it from client config
294+
// cfg.Auth = serverConfig.Auth //Now getting it from client config
295+
// cfg.Cipher = serverConfig.Cipher //Now getting it from client config
294296

295297
destPath := filepath.Join(state.GlobalCfg.OVConfigPath, "clients", name+".ovpn")
296298
if err := SaveToFile(filepath.Join(c.ConfigDir, "openvpn-client-config.tpl"), cfg, destPath); err != nil {

views/ovclient.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ <h3 class="card-title">Client configuration template for .opvn file</h3>
4141
</div>
4242

4343
<div class="form-group">
44-
<label for="name">Proto</label>
44+
<label for="name">Proto</label> <span id="helpBlock" class="text-muted">Don't forget to change server configuration side.</span>
4545
<input type="text" class="form-control" id="Proto" name="Proto" placeholder="Enter external server protocol"
4646
value="{{ .Settings.Proto }}">
4747
</div>
@@ -112,13 +112,13 @@ <h3 class="card-title">Client configuration template for .opvn file</h3>
112112
</div>
113113

114114
<div class="form-group">
115-
<label for="name">Cipher</label>
115+
<label for="name">Cipher</label> <span id="helpBlock" class="text-muted">Don't forget to change server configuration side.</span>
116116
<input type="text" class="form-control" id="Cipher" name="Cipher" placeholder="AES-256-CBC"
117117
value="{{ .Settings.Cipher }}">
118118
</div>
119119

120120
<div class="form-group">
121-
<label for="name">Auth</label>
121+
<label for="name">Auth</label> <span id="helpBlock" class="text-muted">Don't forget to change server configuration side.</span>
122122
<input type="text" class="form-control" id="Auth" name="Auth" placeholder="SHA512"
123123
value="{{ .Settings.Auth }}">
124124
</div>

0 commit comments

Comments
 (0)