title: Sign certificate request error "Expecting trusted request"
body: <p>I tried to use openssl to sign cert request with my own CA. There are two options.</p>
  
  <ol>
  <li><p><code>openssl x509</code>.</p>
  
  <pre><code>openssl X509 -req -CA ca.crt -CAkey ca.pem -in bob.csr -out bob.crt -CAcreateserial`
  </code></pre></li>
  </ol>
  
  <p>Some posts say x509 is used to generate self-signed certificates.</p>
  
  <p>But error occurs using <code>openssl X509</code>:</p>
  
  <pre><code>unable to load certificate
  6612:error:0906D06C:PEM routines:PEM_read_bio:no start       
  line:.\crypto\pem\pem_lib.c:701:Expecting: TRUSTED CERTIFICATE
  </code></pre>
  
  <ol start="2">
  <li><p><code>openssl ca</code>:</p>
  
  <pre><code>openssl ca -in bob.csr -out bob.crt -keyfile ca.key
  </code></pre></li>
  </ol>
  
  <p>It needs to config openssl.config beforehand. E.g., create dir <code>./demoCA</code>.</p>
  
  <p>Please let me know which way is correct. If <code>openssl x509</code> is correct, how to solve <code>expecting trusted certificate</code> error? Very appreciate!</p>