Sorry, My mistake, there's two things must be highlighted:
The CA cert Common Name must not same to the server/client side cert
The server/client side cert's common name must be same
I'm trying to using self-signed certificate for HTTPS Client side certificate. But, there's a problem " SSL: unable to obtain common name from peer certificate "
As you can see, the server side cert contains Common Name, why this problem occurs?
Here's curl output:
- About to connect() to 127.0.0.1 port 443 (#0)
Here's
#openssl x509 -in server.crt -text -noout
Certificate: Data: Version: 1 (0x0) Serial Number: 15298562268347408844 (0xd44f6953eb0aa1cc) Signature Algorithm: sha1WithRSAEncryption Issuer: C=CN, ST=Beijing, L=Beijing, O=OKK, OU=Test, CN=MyComp Validity :
Try CURLOPT_SSL_VERIFYHOST=0 or curl -k
Without knowing the data used to generate the CSR, it looks like the last component of your DN does not contain a CN attribute with the target host name. Typically SSL library clients will only check the first component for the CN attribute equal to the target host name. I would reverse the DN order and add a CN attribute with the host name.
If you provide more details on how you generated the CSR I would be happy to help you figure out how to fix it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With