valet: valet secure returns issue about undefined command line value

When trying to run valet secure, I see the following error:

valet secure mydomain

In Process.php line 1648:

  Command line is missing a value for key "$NF": sudo security find-certificate -e "mydomain.test@laravel.valet" -a -Z | grep SHA-1 | sudo awk '{system("securi
  ty delete-certificate -Z "$NF" /Library/Keychains/System.keychain")}'.


secure [<domain>]

I’m not sure what the shell variable $NF should be set to or why it isn’t set already.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 37 (8 by maintainers)

Most upvoted comments

https://github.com/laravel/valet/releases/tag/v2.5.3 This should be fixed in this release, thanks to @drbyte’s unpaid and tireless work making this project better for all of us. If anyone has a similar issue after upgrading, please feel free to open a new issue. Thanks!

Temporary workaround: Downgrading Process to 4.3 seems to prevent it: composer global require symfony/process:"4.3.*"

Alternatively, changing Sites.php to replace "$NF" with \'$NF\' appears to work too … which I’ll send a PR for.

Thank @mattstauffer much appreciated sorry if it came across like i was irritated, please understand i wasn’t. I just felt the issue needed to be addressed. So please accept my apologies.

I’m still running into the problem. More of my environment:

Laravel Valet 2.3.4
ProductName:	Mac OS X
ProductVersion:	10.15.1
BuildVersion:	19B88
PHP 7.3.11 (cli) (built: Oct 24 2019 11:29:00) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.11, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.11, Copyright (c) 1999-2018, by Zend Technologies
nginx version: nginx/1.15.0
built by clang 9.1.0 (clang-902.0.39.2)
built with OpenSSL 1.0.2o  27 Mar 2018 (running with OpenSSL 1.0.2r  26 Feb 2019)
LibreSSL 2.8.3
/bin/bash

Using the Mac Terminal, and running sudo security find-certificate -e "mydomain.test@laravel.valet" -a -Z | grep SHA-1 returns nothing