Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

windows - 'openssl' is not recognized as internal or external command

I am trying to execute the following command in command prompt .

keytool -exportcert -alias androiddebugkey -keystore "<path-to-users-directory>.androiddebug.keystore" | openssl sha1 -binary | openssl base64

But the command prompt windows reports:

'openssl' is not recognized as internal or external command.

What ca I do to execute this command in command prompt window?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The error you saw means there's no such program in your %PATH% (external command) and it's also not a built-in shell command (internal command).

Install OpenSSL on your machine. You will also need to check that its installed location is in your %PATH%. By default it probably won't be. As an example, suppose OpenSSL is installed at c:OpenSSL-Win32. The openssl binary is probably located at c:OpenSSL-Win32inopenssl.exe. So you path needs to include c:OpenSSL-Win32in.

Sometimes OpenSSL cannot find its configuration file on Windows. For that, see OpenSSL and error in reading openssl.conf file.


Another option is to use the full path in the command:

keytool -exportcert -alias androiddebugkey -keystore "<path-to-users-directory>.androiddebug.keystore" | ^
  c:OpenSSL-Win32inopenssl.exe sha1 -binary | c:OpenSSL-Win32inopenssl.exe base64

However, this still suffers the OpenSSL configuration file problem detailed at OpenSSL and error in reading openssl.conf file.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...