Openssl problem with keys doctor

Hello!
I am trying to perform the particle keys server and particle keys doctor commands with one of our Electrons.
We have been having stability problems with network connections of some of our several electrons we have in use.
I was hoping running the keys procedure and that it would help with those issues.

Below is the readout from my command window, I am using a windows 7 OS.

I have OpenSSL installed so I am not sure what the problem is.

C:\Users\Bjorgvin>particle keys server
Found DFU device 2b04:d00a
checking file C:\Users\Bjorgvin\AppData\Roaming\npm\node_modules\particle-cli\ke
ys\ec.pub.der
spawning dfu-util -d 2b04:d00a -a 1 -i 0 -s 3298 -D C:\Users\Bjorgvin\AppData\Ro
aming\npm\node_modules\particle-cli\keys\ec.pub.der
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Opening DFU capable USB deviceā€¦
ID 2b04:d00a
Run-time device DFU version 011a
Claiming USB DFU Interfaceā€¦
Setting Alternate Setting #1 ā€¦
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "DCT Flash "
Downloading to address = 0x00000ce2, size = 320
Download [=========================] 100% 320 bytes
Download done.
File downloaded successfully
Invalid DFU suffix signature
A valid DFU suffix will be required in a future dfu-util release!!!
Okay! New keys in place, your device will not restart.

C:\Users\Bjorgvin>particle keys doctor 360024001451343334363036
Found DFU device 2b04:d00a
Found DFU device 2b04:d00a
Error creating keysā€¦ Error: Command failed: C:\Windows\system32\cmd.exe /s /c
"openssl ecparam -name prime256v1 -genkey -out 360024001451343334363036_ec_new.p
em"
ā€˜opensslā€™ is not recognized as an internal or external command,
operable program or batch file.

Make sure your device is in DFU mode (blinking yellow), and that your computer i
s online.
Error - Error: Command failed: C:\Windows\system32\cmd.exe /s /c ā€œopenssl ecpara
m -name prime256v1 -genkey -out 360024001451343334363036_ec_new.pemā€
ā€˜opensslā€™ is not recognized as an internal or external command,
operable program or batch file.

Obviously the installed OpenSSL isnā€™t found.
You need to check your PATH environment variable.

2 Likes

I did add a path to the install directory to the CLI to the system variable: PATH
in my case it is C:\Users\Bjorgvin\AppData\Local\particle

This did not help.
Is the path incorrect.?

Kind regards
Tryggvi

@TreyLocos, Openssl is typically installed in the root directory of the system drive in windows. Did you install CLI using the Windows Installer provided by Particle?

Yes I did use the Windows CLI installer

@TreyLocos, can you show you windows PATH? Also, can you verify that the ā€œOpenSSL-Win32ā€ directory is on the root of the C drive.

Normally you should be able to run openssl from any directory when the PATH is setup correct. Just manually try with CMD

You may get an error message like this

C:\someDir\>openssl
WARNING: can't open config file: C:\OpenSSL-Win64\bin\openssl.cfg

but that's still telling you OpenSSL was found.

BTW

The CLI path is irrelevant, we were talking about the OpenSSL path.

1 Like

If you get this error under Windows:

'openssl' is not recognized as an internal or external command, operable program or batch file.

and you have used the CLI installer as described above, it may work if you do:

cd c:\OpenSSL-Win32\bin
particle keys doctor YOUR_DEVICE_ID

There are additional tips for a missing openssl error on this page, including tips for Mac OS X and Linux.

Rick

2 Likes

Iā€™ve used the CLI installer (1.24.1) and the PATH variable is not properly set (I cant access manually to OpenSSL-Win32\bin).

How the path should be configured? Can I do it manually?

Thank you

SOLUTION:
I had the same problem (particle doctor couldnā€™t find the ssl command which it needs).
I looked where the Windows installation placed the ssl command, then just ran the doctor command from there
CD C:\OpenSSL-Win32\bin
particle doctor

Not as elegant as setting the PATH variable properly but it worked.

1 Like

thanks, i had this same error with particle doctor, i reinstalled the CLI but the problem came back. i did the CD command above and particle doctor worked. my rapildy flashing cyan light is now breathing a sigh of relief.

that particle doctor is misleading because sometimes it doesnt give any errors but doesnt fix the problem you have to keep restarting to get it to work

@jasperza, another solution is to add that path to the windows PATH setting after which you will be able to run OpenSSL from any directory. :wink:

3 Likes