Skip to content
Snippets Groups Projects
Commit 481178da authored by C Shi's avatar C Shi
Browse files

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.
parent 09031d90
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -132,7 +132,11 @@ module LeapCli; module Commands ...@@ -132,7 +132,11 @@ module LeapCli; module Commands
long_running do long_running do
if cmd_exists?('certtool') if cmd_exists?('certtool')
log 0, 'Generating DH parameters (takes a long time)...' log 0, 'Generating DH parameters (takes a long time)...'
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') output = assert_run!('certtool --generate-dh-params --sec-param high')
end
output.sub!(/.*(-----BEGIN DH PARAMETERS-----.*-----END DH PARAMETERS-----).*/m, '\1') output.sub!(/.*(-----BEGIN DH PARAMETERS-----.*-----END DH PARAMETERS-----).*/m, '\1')
output << "\n" output << "\n"
write_file!(:dh_params, output) write_file!(:dh_params, output)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment