<div dir="ltr">Hi openssl-er,<div><br></div><div>I'm newbie in the openssl.</div><div>Recently, I ported the openssl to my embedded linux device and ran the openssl command.</div><div>But there was an error occured.</div><div>I had done google search a lot, but I didn't find the answer.</div><div>My issue is strange, my test steps like below:</div><div>1. copy the openssl, libs, cacert.pem to the embedded linux platform.</div><div><br></div><div>2. run the command:</div><div><div>/tmp #:./openssl s_client -connect <a href="http://curl.haxx.se:443">curl.haxx.se:443</a> -CAfile /tmp/cacert.pem</div></div><div><br></div><div>3. the error log is </div><div>------log ----------------</div><div><div>CONNECTED(00000003)</div><div>depth=0 CN = <a href="http://anja.haxx.se">anja.haxx.se</a></div><div>verify error:num=20:unable to get local issuer certificate</div><div>verify return:1</div><div>depth=0 CN = <a href="http://anja.haxx.se">anja.haxx.se</a></div><div>verify error:num=21:unable to verify the first certificate</div><div>verify return:1</div><div>---</div><div>Certificate chain</div><div> 0 s:/CN=<a href="http://anja.haxx.se">anja.haxx.se</a></div><div>   i:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3</div><div> 1 s:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3</div><div>   i:/O=Digital Signature Trust Co./CN=DST Root CA X3</div><div>---</div><div>Server certificate</div></div><div>----------------------------------</div><div><br></div><div>4. my openssl version -d and version is </div><div><div>/tmp # ./openssl version</div><div>OpenSSL 1.1.0c  10 Nov 2016</div></div><div><div>/tmp # ./openssl version -d</div><div>OPENSSLDIR: "/home/georgeyang/workspace/speech_code/openssl/openssl/final"</div></div><div><br></div><div>5. In my PC, I found this command worked well. It could return the ok value.</div><div>Although the openssl version is 1.0.1f.</div><div>So I think my cacert.pem is right.</div><div><br></div><div>6. I also used other command like:</div><div><div>/tmp # ./openssl s_client -connect <a href="http://curl.haxx.se:443">curl.haxx.se:443</a> -CApath /tmp/cacert.pem</div></div><div><div>/tmp # ./openssl s_client -CApath /home/georgeyang/workspace/speech_code/openssl/openssl/final/ -connect <a href="http://curl.haxx.se:443">curl.haxx.se:443</a></div></div><div><div>/tmp # ./openssl s_client -connect <a href="http://curl.haxx.se:443">curl.haxx.se:443</a> -servername <a href="http://curl.haxx.se">curl.haxx.se</a> -key /etc/ssl/private/ssl-cert-snakeoil.key -CAfile /etc/ssl/certs/cacert.pem</div></div><div>But they are all NG.</div><div><br></div><div>In google, they all said -CAfile or -CApath could help, But it doesn't work for me. >"<</div><div>Please help</div><div><br></div><div>Thx</div></div>