I am using wolfSSL-1.6.5, as I have already ported this library on OS less environment hence not using 1.8.0.
I am using the wolfSSL on both(client and server) the ends for TLS1.2. Client is on OS less environment and server is on PC(windows XP). I am trying to achieve the TLS1.2 in between these clients. I am getting bad certificate error for client certificate when it got transferred to server.
Initially server was not sending the certificate request to client, so I have made ctx->verifypeer field to 1(one). Now it is sending the certificate request to client and client is sending the certificate as well. But I am getting the bad certificate(for client certificate) error at server side i.e. Alert(21) message with level 2(fatal) and description 42(Bad certificate). I have traced in and found that mismatch between "cert->issuerHash" and "signers->hash". Because of hash mismatch server is giving the bad certificate error.
I have used wolfSSL's server certificate(server-cert.pem) for server side and wolfSSL client certificate(client-cert.pem), and stored it in C array(unsigned char) like below,
const unsigned char certBuffer[] = {"-----BEGIN CERTIFICATE-----\n\
....\n\
....\n\
....\n\
-----END CERTIFICATE-----\n"};
“…” replaces actual cert/key data. Is this the right way to store the certificate in C array(unsigned char) or do I need to copy complete file in C array(unsigned char)? This array is used directly by "PemToDerBuffer" function. Same way CA certificate and
CA cert file - ca-cert.pem
Server cert file – server-cert.pem
Server key file – server-key.pem
Client cert file – client-cert.pem
Client key file – client-key.pem
I have following questions,
1. Do I need to implement the function “GenerateSeed”? if yes what will be output in case of OS less environment?
2. I have made change in “ctx->verifypeer” field? Is it correct or should it be done by library itself? If yes what fields?
3. Server is not sending the key? What could be the reason? do we need to do any change in library configuration like done for “ctx->verifypeer” field?
4. I want to use “TLS_RSA_WITH_AES_256_CBC_SHA”, what kind of configuration settings I need to do in libraries?
If you have any document which describes all these things please let me know I will go through it.