title: Error on loading certificate with boost::asio
body: <p>I'm using <em>boost::asio</em> to establish encrypted connection between client and server applications. I generated a private key file and self signed certificate in the following way:</p>
  
  <pre><code>openssl genrsa -out private_key.pem 2048
  openssl req -new -key private_key.pem -out public_key.pem
  </code></pre>
  
  <p>The generated certificate is:</p>
  
  <pre><code>-----BEGIN CERTIFICATE REQUEST-----
  MIICxjCCAa4CAQAwgYAxCzAJBgNVBAYTAkJHMQ4wDAYDVQQIDAVTb2ZpYTEOMAwG
  A1UEBwwFU29maWExDDAKBgNVBAoMA0VHVDEMMAoGA1UECwwDU0JTMRMwEQYDVQQD
  DApJdmFuIEJvYmV2MSAwHgYJKoZIhvcNAQkBFhFib2JlZmZAZWd0LWJnLmNvbTCC
  ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM2OyY0BvtnmtxbPw7tblSc+
  2TOopefy1/voELFT+6SCfmmXhIkL7HXcbFekc0z3VtCaSpq64Tk7NMGPtm2XiVt7
  Yzftw5pItsgyVwGuCk5sAMZ5qtDVjwTJv6m9TEV4hBA91ypYsXgcYBz4CIIw9Zm9
  uSJVznEsnraQE8xFE87D6Z78BLSFej83A7YsGqxPRIbNCtismtj1GeLFegnX/u5l
  PeyPa6A4bgXKgtWFoOEfdCQhWxZwxER0la16JAbMPuKmM+ZM0JJOPBhwdDmXEpv4
  tvZ+LXgVo8v71jKK1eMTjvQA2e3bBqZFtpPi0gvYTENQE1yXoRE479wPDHqrum8C
  AwEAAaAAMA0GCSqGSIb3DQEBCwUAA4IBAQAypIZnsX/C63kdeRoQeMOVJa5CObWr
  ALxtQIHdaR83SzY6K1Gg3SybHMnQ3wVUr71/tcuCYri6hJAzFKNYo676EdOxH8X4
  IJSNQIHUPBRRvcaB2us+wmAEsHhFytzlBdsYNo1UM+QXgDArV/BeHt9R1GYaN9kz
  C8ZSf5IYd/8vjDHRzpoeJ5+n4zMONOtCgXZU2WMEa7n9xbumfTnnZmaYGb3y3VVg
  FHtEAFsM1K80zKDW7Nech1vLXnJVi/SS5ABl+jqLOdVVqM+WKaowJY6y+U786by4
  q55Eoas7JZQIN+g6LeKywWj59CpYpeMczsp/WygKey6JkQ3qi1FiLaUB
  -----END CERTIFICATE REQUEST-----
  </code></pre>
  
  <p>In my program code, I have the following initialization of SSL context structure:</p>
  
  <pre><code>...
  , m_sslContext(ssl::context::sslv23)
  ...
  m_sslContext.set_verify_mode(ssl::verify_peer | ssl::verify_fail_if_no_peer_cert);
  m_sslContext.use_rsa_private_key_file("private_key.pem", ssl::context::pem);
  m_sslContext.use_certificate_file("public_key.pem", ssl::context::pem);
  ...
  </code></pre>
  
  <p><strong>But</strong> <em>use_ceritificate_file</em> method throws exception with message:</p>
  
  <blockquote>
    <p>use_certificate_file: no start line</p>
  </blockquote>
  
  <p>Why does the function fail and what is the correct way to establish a secure connection with <em>boost::asio</em> wrapper around <em>OpenSSL</em>?</p>