summaryrefslogtreecommitdiff
path: root/lib/leap_cli
diff options
context:
space:
mode:
authoricydoge <icydoge@gmail.com>2018-05-09 19:01:47 +0100
committerUnknown <kwadronaut@leap.se>2018-09-04 14:35:38 +0200
commit7fd3e05eddbc89735147d5f6e694ba18cc1392f8 (patch)
tree710309eacb33b2bac8391b743bc8d4d6f1138fab /lib/leap_cli
parent0949724ef67253cebee51d3323f2318b0bdcd46f (diff)
Bug: Fix incorrect certtool being called on macOS/Mac OS X
Apple rolls their own certtool on macOS/Mac OS X, which is distinct from the correct gnutls-certtool from gnutls installed by Homebrew/MacPorts.
Diffstat (limited to 'lib/leap_cli')
-rw-r--r--lib/leap_cli/commands/cert.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/leap_cli/commands/cert.rb b/lib/leap_cli/commands/cert.rb
index 68fa9444..6d963686 100644
--- a/lib/leap_cli/commands/cert.rb
+++ b/lib/leap_cli/commands/cert.rb
@@ -132,7 +132,11 @@ module LeapCli; module Commands
long_running do
if cmd_exists?('certtool')
log 0, 'Generating DH parameters (takes a long time)...'
- output = assert_run!('certtool --generate-dh-params --sec-param high')
+ if (/darwin/ =~ RUBY_PLATFORM) != nil
+ output = assert_run!('gnutls-certtool --generate-dh-params --sec-param high')
+ else
+ output = assert_run!('certtool --generate-dh-params --sec-param high')
+ end
output.sub!(/.*(-----BEGIN DH PARAMETERS-----.*-----END DH PARAMETERS-----).*/m, '\1')
output << "\n"
write_file!(:dh_params, output)