Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BearSSL::WiFiClientSecure' has no member named 'loadCertificate' #23

Open
vuanhachoi opened this issue Jun 13, 2021 · 2 comments
Open

Comments

@vuanhachoi
Copy link

When I try uploading the code into my WeMos D1 Mini board. It gives me the error below:

C:\Users\JakeNguyen\Desktop\ESP8266\mqtt_x509_DER\mqtt_x509_DER.ino: In function 'void setup()':
mqtt_x509_DER:117:17: error: 'class BearSSL::WiFiClientSecure' has no member named 'loadCertificate'
  117 |   if (espClient.loadCertificate(cert))
      |                 ^~~~~~~~~~~~~~~
mqtt_x509_DER:132:17: error: 'class BearSSL::WiFiClientSecure' has no member named 'loadPrivateKey'
  132 |   if (espClient.loadPrivateKey(private_key))
      |                 ^~~~~~~~~~~~~~
mqtt_x509_DER:149:18: error: 'class BearSSL::WiFiClientSecure' has no member named 'loadCACert'
  149 |     if(espClient.loadCACert(ca))
      |                  ^~~~~~~~~~
exit status 1
**'class BearSSL::WiFiClientSecure' has no member named 'loadCertificate'**

Im not sure how to fix this problem. If anyone has an idea how to fix it, please help me!

@copercini
Copy link
Owner

This code was initially designed for axTLS, so it has different APIs of BearSSL, but you can replace it using: setTrustAnchors and setRSACert

Like in this example: https://github.com/esp8266/Arduino/blob/da6ec83b5fdbd5b02f04cf143dcf8e158a8cfd36/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino

@vuanhachoi
Copy link
Author

vuanhachoi commented Jun 13, 2021

Thank you for your response!
Would it be possible you can tell me where I can replace it in the code please? From the exam you gave it, can I just copy set TrustAnchors and serRSACert into the original code or I can copy the whole void setup() function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants