<div dir="ltr">can't reproduce:<br><br>Erlang/OTP 17 [erts-6.4] [source] [64-bit] [smp:8:8] [async-threads:10] [kernel-poll:false]<br><br>Eshell V6.4 (abort with ^G)<br>1> application:ensure_all_started(ssl).<br>{ok,[crypto,asn1,public_key,ssl]}<br>2> ssl:connect( "<a href="http://www.nicemine.ru">www.nicemine.ru</a>", 443, [{verify,verify_peer},{server_name_indication,"<a href="http://www.nicemine.ru">www.nicemine.ru</a>"},{depth,2},{cacertfile,"cacert.pem"}] ).<br>{ok,{sslsocket,{gen_tcp,#Port<0.821>,tls_connection,<br> undefined},<br> <0.49.0>}}<br><br><br><br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div><br></div>--<div>Santiago</div></div></div>
<br><div class="gmail_quote">On Thu, Jul 16, 2015 at 2:54 PM, Alex Hudich <span dir="ltr"><<a href="mailto:alttagil@gmail.com" target="_blank">alttagil@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Hi,</div><div><br></div><div>It doesn’t help. Still <span style="font-family:Menlo;font-size:18px">{bad_cert,invalid_issuer}</span></div><div><span style="font-family:Menlo;font-size:18px"><br></span></div><div><span style="font-family:Menlo;font-size:18px"><br></span></div><br><div><blockquote type="cite"><div>16 июля 2015 г., в 20:29, Éric Pailleau <<a href="mailto:eric.pailleau@wanadoo.fr" target="_blank">eric.pailleau@wanadoo.fr</a>> написал(а):</div><div><div class="h5"><br><div>Hi, try with depth = 3. Depth 0 to depth 2 is 3.<br>Regards<br><br>Le 16 juil. 2015 15:15, Alex Hudich <<a href="mailto:alttagil@gmail.com" target="_blank">alttagil@gmail.com</a>> a écrit :<br><blockquote type="cite"><br>When I tried to check connection with openssl command I’ve got w/o cacert.pem file:<br><br>$ openssl s_client -connect <a href="http://nicemine.ru" target="_blank">nicemine.ru</a>:443 -verify 99 <br>verify depth is 99<br>CONNECTED(00000003)<br>depth=2 /C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Certification Authority<br>verify error:num=19:self signed certificate in certificate chain<br>verify return:1<br>depth=2 /C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Certification Authority<br>verify return:1<br>depth=1 /C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Class 1 Primary Intermediate Server CA<br>verify return:1<br>depth=0 /<a href="mailto:C=KZ/CN=www.nicefiles.ru/emailAddress=webmaster@nicefiles.ru" target="_blank">C=KZ/CN=www.nicefiles.ru/emailAddress=webmaster@nicefiles.ru</a><br>verify return:1<br><br><br>and with it<br><br>$ openssl s_client -connect <a href="http://nicemine.ru" target="_blank">nicemine.ru</a>:443 -verify 99 -CAfile cacert.pem<br>verify depth is 99<br>CONNECTED(00000003)<br>depth=2 /C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Certification Authority<br>verify return:1<br>depth=1 /C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Class 1 Primary Intermediate Server CA<br>verify return:1<br>depth=0 /<a href="mailto:C=KZ/CN=www.nicefiles.ru/emailAddress=webmaster@nicefiles.ru" target="_blank">C=KZ/CN=www.nicefiles.ru/emailAddress=webmaster@nicefiles.ru</a><br>verify return:1<br><br>so cacert.pem file contains enough info for StartCom certificates to be checked as valid.<br><br><br>Also I’ve tried to dig it more in erlang and I’ve found that I get error in OTP 18 too.<br><br>And the reason for bad certificate error is {bad_cert,invalid_issuer}<br><br><br><br>I also tried to add <a href="https://www.startssl.com/certs/sub.class1.server.ca.pem" target="_blank">https://www.startssl.com/certs/sub.class1.server.ca.pem</a> file to cacert.pem but with no luck.<br><br><br><br><br><br><blockquote type="cite">16 июля 2015 г., в 12:16, Alex Hudich <<a href="mailto:alttagil@gmail.com" target="_blank">alttagil@gmail.com</a>> написал(а):<br><br>Hi!<br><br><br><br>wget <a href="http://curl.haxx.se/ca/cacert.pem" target="_blank">http://curl.haxx.se/ca/cacert.pem</a><br><br>and then <br><br>ssl:connect( "<a href="http://www.nicemine.ru" target="_blank">www.nicemine.ru</a>", 443, [{verify,verify_peer},{server_name_indication,"<a href="http://www.nicemine.ru" target="_blank">www.nicemine.ru</a>"},{depth,2},{cacertfile,"cacert.pem"}] ).<br><br>gives me {error,{tls_alert,"bad certificate"}}<br><br><br><br>Why? Site can be opened ok in the browser.<br><br>Erlang/OTP 17 [erts-6.3] <br><br><br></blockquote><br></blockquote></div></div></div></blockquote></div><br></div><br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>