From 438ae98b1ce7b50b0e8b72f1e7dc467ffe4c7087 Mon Sep 17 00:00:00 2001 From: Adam Shannon Date: Mon, 26 Nov 2018 09:03:40 -0800 Subject: [PATCH] java: don't try to run keytool during check if it's not available (#90) If JAVA_HOME isn't set then keytoolPath has an invalid path. This means checkJava() fails and doesn't tell the problem clearly to the user. Fixes #88 --- truststore_java.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/truststore_java.go b/truststore_java.go index a7d3980..aa7cd18 100644 --- a/truststore_java.go +++ b/truststore_java.go @@ -58,6 +58,10 @@ func init() { } func (m *mkcert) checkJava() bool { + if !hasKeytool { + return false + } + // exists returns true if the given x509.Certificate's fingerprint // is in the keytool -list output exists := func(c *x509.Certificate, h hash.Hash, keytoolOutput []byte) bool {