Repository navigation
Closed
Description
I tried to build the echo_server example as described on the WolfSSL page at https://www.wolfssl.com/wolfssh-now-available-as-an-espressif-managed-component-includes-ssh-echo-server-example/
I'm using ESP-IDF 5.5 on macOS. I created the example project with: idf.py create-project-from-example "wolfssl/wolfssh:wolfssh_echoserver". Configured Wifi credentials with menuconfig and then tried to build the project with idf.py build.
But the project failed to build with the following messages:
In file included from /Users/fastjack/Developer/IoT/wolfssh_echoserver/main/echoserver.c:65:
/Users/fastjack/Developer/IoT/wolfssh_echoserver/managed_components/wolfssl__wolfssh/wolfssh/certs_test.h:27:28: error: redefinition of 'rsa_key_der_2048'
27 | static const unsigned char rsa_key_der_2048[] =
| ^~~~~~~~~~~~~~~~
In file included from /Users/fastjack/Developer/IoT/wolfssh_echoserver/managed_components/wolfssl__wolfssl/include/user_settings.h:1062,
from /Users/fastjack/Developer/IoT/wolfssh_echoserver/managed_components/wolfssl__wolfssl/wolfssl/wolfcrypt/settings.h:340,
from /Users/fastjack/Developer/IoT/wolfssh_echoserver/main/echoserver.c:29:
/Users/fastjack/Developer/IoT/wolfssh_echoserver/managed_components/wolfssl__wolfssl/wolfssl/certs_test.h:1384:28: note: previous definition of 'rsa_key_der_2048' with type 'const unsigned char[1191]'
1384 | static const unsigned char rsa_key_der_2048[] =
| ^~~~~~~~~~~~~~~~
/Users/fastjack/Developer/IoT/wolfssh_echoserver/managed_components/wolfssl__wolfssh/wolfssh/certs_test.h:150:18: error: redefinition of 'sizeof_rsa_key_der_2048'
150 | static const int sizeof_rsa_key_der_2048 = sizeof(rsa_key_der_2048);
| ^~~~~~~~~~~~~~~~~~~~~~~
/Users/fastjack/Developer/IoT/wolfssh_echoserver/managed_components/wolfssl__wolfssl/wolfssl/certs_test.h:1507:18: note: previous definition of 'sizeof_rsa_key_der_2048' with type 'int'
1507 | static const int sizeof_rsa_key_der_2048 = sizeof(rsa_key_der_2048);
| ^~~~~~~~~~~~~~~~~~~~~~~
/Users/fastjack/Developer/IoT/wolfssh_echoserver/managed_components/wolfssl__wolfssh/wolfssh/certs_test.h:153:28: error: redefinition of 'ecc_key_der_256'
153 | static const unsigned char ecc_key_der_256[] =
| ^~~~~~~~~~~~~~~
/Users/fastjack/Developer/IoT/wolfssh_echoserver/managed_components/wolfssl__wolfssl/wolfssl/certs_test.h:6187:28: note: previous definition of 'ecc_key_der_256' with type 'const unsigned char[121]'
6187 | static const unsigned char ecc_key_der_256[] =
| ^~~~~~~~~~~~~~~
/Users/fastjack/Developer/IoT/wolfssh_echoserver/managed_components/wolfssl__wolfssh/wolfssh/certs_test.h:169:18: error: redefinition of 'sizeof_ecc_key_der_256'
169 | static const int sizeof_ecc_key_der_256 = sizeof(ecc_key_der_256);
| ^~~~~~~~~~~~~~~~~~~~~~
/Users/fastjack/Developer/IoT/wolfssh_echoserver/managed_components/wolfssl__wolfssl/wolfssl/certs_test.h:6203:18: note: previous definition of 'sizeof_ecc_key_der_256' with type 'int'
6203 | static const int sizeof_ecc_key_der_256 = sizeof(ecc_key_der_256);
| ^~~~~~~~~~~~~~~~~~~~~~
Steps to reproduce:
- Set up ESP-IDF paths with
source ~/esp/v5.5/esp-idf/export.sh idf.py create-project-from-example "wolfssl/wolfssh:wolfssh_echoserver"- Enter project directory and build with
idf.py build
Metadata
Metadata
Assignees
Labels
No labels
Activity
embhorn commentedon Aug 21, 2025
Hello @fastjack ,
Thanks for contacting wolfSSL Support. I have requested a review of this issue by our engineers. Could you tell us a bit about your ESP32 project using wolfSSL?
Thanks,
@embhorn - wolfSSL Support
gojimmypi commentedon Aug 21, 2025
Hi @fastjack and @embhorn
I've confirmed this is problematic with multiple versions of the ESP-IDF. I tested on latest master ESP-IDF v6.0
The root cause appears to be specific the the most recent v5.8.2 Managed Component release of wolfSSL which was not tested against the prior published wolfSSH examples.
Specifically, the same-name
certs_test.hfile is included in bothwolfSSLandwolfSSHcomponents,... but gated with
#define WOLFSSL_CERTS_TEST_H(SSL) and#define _WOLFSSH_CERTS_TEST_H_(SSH), respectfully.As an interim fix until I resolve this, one can set an explicit version of wolfSSL in the
wolfssh_echoserver/main/idf_component.yml:Note the last line was changed from the default:
to
... to use the prior release from current wolfssl
v5.8.2. Be sure to OMIT the "greater than version" carat:^char.Be sure to fully clean the prior build from the
wolfssh_echoserverdirectory:See also: wolfSSL/wolfssl#9099 that changed
sizeofdefinitions to macros after the v5.8.2 release.gojimmypi commentedon Aug 21, 2025
Update: the root cause of this problem is from wolfSSL/wolfssl#8813, specifically line 1084 of the template example
user_settings.h.The reminder in comments to
#include <wolfssl/certs_test.h>was uncommented, thus causing conflicts between thecerts_test.hin wolfSSL and the same-name file in wolfSSH.An alternative solution to this problem would be to simply edit the respective user settings file in:
and comment out the
#include <wolfssl/certs_test.h>line.Of course, in doing so, one would also need to then convert the entire component to a non-managed one as prompted.
A post-release wolfSSL Managed Component will be needed - as once published, version numbers cannot be reused.
gojimmypi commentedon Aug 24, 2025
Hi @fastjack -
I've published a minor revision 5.8.2~1 of wolfssl in the ESP Registry that uses the current minor change in wolfSSL/wolfssl#9123 to comment out the
#include <wolfssl/certs_test.h>.No other changes were made to wolfSSL core library. This is still based on the 5.8.2 release; none of the other post release changes were added.
I've confirmed the wolfSSH
idf.py create-project-from-example "wolfssl/wolfssh=1.4.20:wolfssh_echoserver"now works properly, albeit with a few warnings in ESP-IDF v6.0 about newly deprecated SNTP functions.fastjack commentedon Aug 24, 2025
I was able to create a new project and build it successfully. The example works as advertised. Thank you!
gojimmypi commentedon Aug 24, 2025
Hi @fastjack - thanks for confirming the update works for you.
If you are interested in another wolfSSH example for Espressif devices, check out the SSH to UART example:
https://github.com/wolfSSL/wolfssh-examples/tree/main/Espressif/ESP32/ESP32-SSH-Server
Let me know if there's anything I can do to help you with your project.