ssl: make cert check ignore work for invalid certs, not just CNs
ssl: make cert check ignore work for invalid certs, not just CNs

Passing SSL_VERIFY_PEER makes OpenSSL shut down the connection if the
certificate is invalid, without giving us a chance to ignore that
error. Pass SSL_VERIFY_NONE and call SSL_get_verify_result if the user
wanted us to check.

When no CNs match, we used to jump to on_error which gave a bogus
error as that's for OpenSSL errors. Jump to cert_fail so we tell the
user that the error came from checking the certificate.

joshtriplett/libgit2,dleehr/libgit2,oaastest/libgit2,t0xicCode/libgit2,claudelee/libgit2,magnus98/TEST,mhp/libgit2,mhp/libgit2,amyvmiwei/libgit2,leoyanggit/libgit2,whoisj/libgit2,jflesch/libgit2-mariadb,yosefhackmon/libgit2,KTXSoftware/libgit2,since2014/libgit2,mingyaaaa/libgit2,mcanthony/libgit2,rcorre/libgit2,rcorre/libgit2,raybrad/libit2,yongthecoder/libgit2,dleehr/libgit2,joshtriplett/libgit2,Snazz2001/libgit2,amyvmiwei/libgit2,since2014/libgit2,zodiac/libgit2.js,raybrad/libit2,yongthecoder/libgit2,mingyaaaa/libgit2,yosefhackmon/libgit2,yongthecoder/libgit2,jamieleecool/ptest,since2014/libgit2,Aorjoa/libgit2_maked_lib,falqas/libgit2,saurabhsuniljain/libgit2,jeffhostetler/public_libgit2,magnus98/TEST,MrHacky/libgit2,chiayolin/libgit2,t0xicCode/libgit2,skabel/manguse,spraints/libgit2,jamieleecool/ptest,sygool/libgit2,mingyaaaa/libgit2,ardumont/libgit2,skabel/manguse,jamieleecool/ptest,dleehr/libgit2,KTXSoftware/libgit2,ardumont/libgit2,jeffhostetler/public_libgit2,sim0629/libgit2,claudelee/libgit2,nacho/libgit2,stewid/libgit2,stewid/libgit2,chiayolin/libgit2,leoyanggit/libgit2,mhp/libgit2,kissthink/libgit2,kissthink/libgit2,Tousiph/Demo1,maxiaoqian/libgit2,JIghtuse/libgit2,jamieleecool/ptest,sygool/libgit2,iankronquist/libgit2,maxiaoqian/libgit2,Corillian/libgit2,sygool/libgit2,Tousiph/Demo1,amyvmiwei/libgit2,jflesch/libgit2-mariadb,iankronquist/libgit2,amyvmiwei/libgit2,kenprice/libgit2,swisspol/DEMO-libgit2,Snazz2001/libgit2,MrHacky/libgit2,chiayolin/libgit2,since2014/libgit2,kissthink/libgit2,evhan/libgit2,Snazz2001/libgit2,JIghtuse/libgit2,kenprice/libgit2,MrHacky/libgit2,mrksrm/Mingijura,mcanthony/libgit2,yosefhackmon/libgit2,kissthink/libgit2,jflesch/libgit2-mariadb,stewid/libgit2,falqas/libgit2,falqas/libgit2,saurabhsuniljain/libgit2,yosefhackmon/libgit2,t0xicCode/libgit2,jflesch/libgit2-mariadb,t0xicCode/libgit2,MrHacky/libgit2,nacho/libgit2,stewid/libgit2,yongthecoder/libgit2,nokiddin/libgit2,Aorjoa/libgit2_maked_lib,Snazz2001/libgit2,Corillian/libgit2,ardumont/libgit2,claudelee/libgit2,skabel/manguse,KTXSoftware/libgit2,linquize/libgit2,nacho/libgit2,oaastest/libgit2,Tousiph/Demo1,kenprice/libgit2,mrksrm/Mingijura,sygool/libgit2,falqas/libgit2,yongthecoder/libgit2,claudelee/libgit2,chiayolin/libgit2,saurabhsuniljain/libgit2,nokiddin/libgit2,zodiac/libgit2.js,Snazz2001/libgit2,Tousiph/Demo1,sim0629/libgit2,skabel/manguse,zodiac/libgit2.js,rcorre/libgit2,evhan/libgit2,evhan/libgit2,linquize/libgit2,claudelee/libgit2,dleehr/libgit2,mingyaaaa/libgit2,kissthink/libgit2,dleehr/libgit2,jflesch/libgit2-mariadb,magnus98/TEST,mrksrm/Mingijura,JIghtuse/libgit2,JIghtuse/libgit2,leoyanggit/libgit2,swisspol/DEMO-libgit2,amyvmiwei/libgit2,KTXSoftware/libgit2,whoisj/libgit2,skabel/manguse,dleehr/libgit2,Aorjoa/libgit2_maked_lib,spraints/libgit2,sygool/libgit2,whoisj/libgit2,iankronquist/libgit2,claudelee/libgit2,jeffhostetler/public_libgit2,sim0629/libgit2,maxiaoqian/libgit2,jflesch/libgit2-mariadb,mhp/libgit2,stewid/libgit2,JIghtuse/libgit2,chiayolin/libgit2,spraints/libgit2,nokiddin/libgit2,joshtriplett/libgit2,zodiac/libgit2.js,jeffhostetler/public_libgit2,KTXSoftware/libgit2,saurabhsuniljain/libgit2,joshtriplett/libgit2,iankronquist/libgit2,stewid/libgit2,sim0629/libgit2,Tousiph/Demo1,since2014/libgit2,yongthecoder/libgit2,nokiddin/libgit2,zodiac/libgit2.js,mingyaaaa/libgit2,joshtriplett/libgit2,leoyanggit/libgit2,Aorjoa/libgit2_maked_lib,yosefhackmon/libgit2,iankronquist/libgit2,whoisj/libgit2,jeffhostetler/public_libgit2,whoisj/libgit2,spraints/libgit2,falqas/libgit2,t0xicCode/libgit2,sygool/libgit2,JIghtuse/libgit2,Corillian/libgit2,oaastest/libgit2,kenprice/libgit2,t0xicCode/libgit2,nokiddin/libgit2,maxiaoqian/libgit2,raybrad/libit2,mingyaaaa/libgit2,spraints/libgit2,rcorre/libgit2,swisspol/DEMO-libgit2,MrHacky/libgit2,Corillian/libgit2,swisspol/DEMO-libgit2,mcanthony/libgit2,magnus98/TEST,leoyanggit/libgit2,falqas/libgit2,oaastest/libgit2,linquize/libgit2,mcanthony/libgit2,rcorre/libgit2,mrksrm/Mingijura,ardumont/libgit2,mrksrm/Mingijura,MrHacky/libgit2,ardumont/libgit2,Aorjoa/libgit2_maked_lib,linquize/libgit2,linquize/libgit2,saurabhsuniljain/libgit2,swisspol/DEMO-libgit2,KTXSoftware/libgit2,rcorre/libgit2,nokiddin/libgit2,mcanthony/libgit2,magnus98/TEST,yosefhackmon/libgit2,since2014/libgit2,Corillian/libgit2,joshtriplett/libgit2,raybrad/libit2,Corillian/libgit2,skabel/manguse,kenprice/libgit2,maxiaoqian/libgit2,sim0629/libgit2,magnus98/TEST,jeffhostetler/public_libgit2,ardumont/libgit2,nacho/libgit2,mhp/libgit2,whoisj/libgit2,evhan/libgit2,oaastest/libgit2,swisspol/DEMO-libgit2,sim0629/libgit2,maxiaoqian/libgit2,kissthink/libgit2,chiayolin/libgit2,Tousiph/Demo1,linquize/libgit2,kenprice/libgit2,iankronquist/libgit2,amyvmiwei/libgit2,saurabhsuniljain/libgit2,mhp/libgit2,raybrad/libit2,leoyanggit/libgit2,mrksrm/Mingijura,spraints/libgit2,oaastest/libgit2,Snazz2001/libgit2,mcanthony/libgit2