I encountered this problem too. It seems to be a problem with the openssl library that is preinstalled on your system. Here’s what worked for me:
- Install homebrew (if you haven’t already)
- brew install openssl
- Run brew --prefix opensslto get the location of the binary you just installed (for me this was/usr/local/opt/openssl@1.1/bin/openssl)
- Run the genpkeycommand using the path to the binary/usr/local/opt/openssl@1.1/bin/openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256 -pkeyopt ec_param_enc:named_curve -outform PEM -out ecdsasigner.key