igrr / axtls-8266

axTLS port for ESP8266

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not a valid ASN.1 file

slaff opened this issue · comments

commented

When integrating the code in another ESP8266 framework I am getting the following error before handshake.

Error: This is not a valid ASN.1 file
Error: Invalid X509 ASN.1 file (X509 not ok)

What can be the reason for this? With the Linux axtls code (without additions from this repo) it seems to work. Any suggestion?

Which server should I use to reproduce this?

commented

I used the following key and certificate and I got this response testing with www.google.com and a lot of other servers. Actually I do not remember not getting this error.

I wonder why would you need client certificate when you connect to google.com... If the server doesn't request client certificate it is not used.
Anyway, I'll check and see what's the issue with certificate loading.

is this because the client certificate was generated without -addtrust clientAuth in openssl?

commented

@igrr @noelgeorgi It turned out that the key and certificate that I was passing to ssl_obj_memory_load were in PEM format, whereas axTLS expects them at that stage to be in DER format. Passing the data in DER format fixed the issue.