title: SSL: unable to obtain common name from peer certificate
body: <p>Sorry, My mistake, there's two things must be highlighted:</p>
  <pre><code>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
  </code></pre>
  <p>I'm trying to using self-signed certificate for HTTPS Client side certificate.
  But, there's a problem &quot; SSL: unable to obtain common name from peer certificate &quot;</p>
  <p>As you can see, the server side cert contains Common Name, why this problem occurs?</p>
  <p>Here's curl output:</p>
  <blockquote>
  <ul>
  <li>About to connect() to 127.0.0.1 port 443 (#0)</li>
  </ul>
  </blockquote>
  <ul>
  <li>Trying 127.0.0.1... connected
  Enter PEM pass phrase:</li>
  <li>successfully set certificate verify locations:</li>
  <li>CAfile: /home/freeman/dev/git/ca_tools/ca_tools/ssl/CA/secure_ca.crt
  CApath: /etc/ssl/certs</li>
  <li>SSLv3, TLS handshake, Client hello (1):</li>
  <li>SSLv3, TLS handshake, Server hello (2):</li>
  <li>SSLv3, TLS handshake, CERT (11):</li>
  <li>SSLv3, TLS handshake, Server key exchange (12):</li>
  <li>SSLv3, TLS handshake, Request CERT (13):</li>
  <li>SSLv3, TLS handshake, Server finished (14):</li>
  <li>SSLv3, TLS handshake, CERT (11):</li>
  <li>SSLv3, TLS handshake, Client key exchange (16):</li>
  <li>SSLv3, TLS handshake, CERT verify (15):</li>
  <li>SSLv3, TLS change cipher, Client hello (1):</li>
  <li>SSLv3, TLS handshake, Finished (20):</li>
  <li>SSLv3, TLS change cipher, Client hello (1):</li>
  <li>SSLv3, TLS handshake, Finished (20):</li>
  <li>SSL connection using ECDHE-RSA-AES256-SHA</li>
  <li>Server certificate:</li>
  <li>subject: C=CN; ST=Beijing; L=Beijing; O=XiaoMi</li>
  <li>start date: 2014-05-14 12:50:20 GMT</li>
  <li>expire date: 2024-05-11 12:50:20 GMT</li>
  <li>SSL: unable to obtain common name from peer certificate</li>
  <li>Closing connection #0</li>
  <li>SSLv3, TLS alert, Client hello (1):</li>
  </ul>
  <p>Here's<br />
  #openssl x509 -in server.crt -text -noout</p>
  <blockquote>
  <p>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
  :</p>
  </blockquote>