Hello Malik,
Thanks for joining the wolfSSL Forums.
The -322 code corresponds to the following error in wolfssl/error-ssl.h
DOMAIN_NAME_MISMATCH = -322, /* peer subject name mismatch */
The error code DOMAIN_NAME_MISMATCH would make sense if you are using a certificate issued for one domain with a different domain.
Could you please provide some more details such as the domains in question, the cert(s) in question and how we might reproduce on our end?
Do you have a site accessible that we can test against and a copy of the certificate in question?
Kind regards,
Eric @ wolfSSL Support