草庐IT

CERTIFICATE

全部标签

python - 抓取 : SSL: CERTIFICATE_VERIFY_FAILED error for http://en. wikipedia.org

我正在练习“WebScrapingwithPython”中的代码,但我一直遇到这个证书问题:fromurllib.requestimporturlopenfrombs4importBeautifulSoupimportrepages=set()defgetLinks(pageUrl):globalpageshtml=urlopen("http://en.wikipedia.org"+pageUrl)bsObj=BeautifulSoup(html)forlinkinbsObj.findAll("a",href=re.compile("^(/wiki/)")):if'href'inlin

python - 如何使用 python 检索远程主机的 TLS/SSL 对等证书?

我需要扫描IP列表并从该IP上的证书中检索公用名(对于允许端口443连接的每个IP)。我已经能够使用套接字和ssl模块成功地做到这一点。它适用于所有具有有效签名证书的IP,但不适用于自签名证书。如果我使用这种方法,它需要一个由我的CA-bundle验证的有效证书:fromsocketimportsocketimportssls=socket()c=ssl.wrap_socket(s,cert_reqs=ssl.CERT_REQUIRED,ca_certs='ca-bundle.crt')c.connect(('127.0.0.1',443))printc.getpeercert()如果

python - 如何使用 python 检索远程主机的 TLS/SSL 对等证书?

我需要扫描IP列表并从该IP上的证书中检索公用名(对于允许端口443连接的每个IP)。我已经能够使用套接字和ssl模块成功地做到这一点。它适用于所有具有有效签名证书的IP,但不适用于自签名证书。如果我使用这种方法,它需要一个由我的CA-bundle验证的有效证书:fromsocketimportsocketimportssls=socket()c=ssl.wrap_socket(s,cert_reqs=ssl.CERT_REQUIRED,ca_certs='ca-bundle.crt')c.connect(('127.0.0.1',443))printc.getpeercert()如果

python - ssl.SSLError : [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl. c:749)

我正在尝试使用来自Github(https://github.com/gto76/betbrain-scraper)的betbrain.py,它具有以下代码:#!/usr/bin/python3##Usage:betbrain.py[URLorFILE][OUTPUT-FILE]#Scrapesoddsfrompassedbetbrainpageandwritesthemto#stdout,orfileifspecified.importosimportsysimporturllib.requestfrombs4importBeautifulSoupfromhttp.cookiejar

python - ssl.SSLError : [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl. c:749)

我正在尝试使用来自Github(https://github.com/gto76/betbrain-scraper)的betbrain.py,它具有以下代码:#!/usr/bin/python3##Usage:betbrain.py[URLorFILE][OUTPUT-FILE]#Scrapesoddsfrompassedbetbrainpageandwritesthemto#stdout,orfileifspecified.importosimportsysimporturllib.requestfrombs4importBeautifulSoupfromhttp.cookiejar

javax.net.ssl.SSLPeerUnverifiedException : Host name does not match the certificate subject provided by the peer

我在stackoverflow上关注了许多链接并尝试了许多解决方案,但没有一个对我有用。我正在使用WSO2APImanager版本1.9.1。我面临以下错误:Exceptioninthread"main"javax.net.ssl.SSLPeerUnverifiedException:Hostname'XXXXXXXXX'doesnotmatchthecertificatesubjectprovidedbythepeer(CN=localhost,O=WSO2,L=MountainView,ST=CA,C=US)atorg.apache.http.conn.ssl.SSLConnect

javax.net.ssl.SSLPeerUnverifiedException : Host name does not match the certificate subject provided by the peer

我在stackoverflow上关注了许多链接并尝试了许多解决方案,但没有一个对我有用。我正在使用WSO2APImanager版本1.9.1。我面临以下错误:Exceptioninthread"main"javax.net.ssl.SSLPeerUnverifiedException:Hostname'XXXXXXXXX'doesnotmatchthecertificatesubjectprovidedbythepeer(CN=localhost,O=WSO2,L=MountainView,ST=CA,C=US)atorg.apache.http.conn.ssl.SSLConnect

java - 从证书中获取公钥

我正在尝试使用以下方法获取证书的公钥:FileInputStreamfin=newFileInputStream("PathToCertificate");CertificateFactoryf=CertificateFactory.getInstance("X.509");X509Certificatecertificate=(X509Certificate)f.generateCertificate(fin);PublicKeypk=certificate.getPublicKey();但我收到以下错误:Exceptioninthread"main"java.lang.ClassC

java - 从证书中获取公钥

我正在尝试使用以下方法获取证书的公钥:FileInputStreamfin=newFileInputStream("PathToCertificate");CertificateFactoryf=CertificateFactory.getInstance("X.509");X509Certificatecertificate=(X509Certificate)f.generateCertificate(fin);PublicKeypk=certificate.getPublicKey();但我收到以下错误:Exceptioninthread"main"java.lang.ClassC

java - Keytool 设置主机名

我只是尝试使用javakeytool,但我不知道如何设置主机名。这就是我正在尝试的方式:hostname[username:/this/is/a/path][640]%keytool-keystoreserver.keystore-genkeypair-aliashostnameEnterkeystorepassword:Re-enternewpassword:Whatisyourfirstandlastname?[Unknown]:hostnameWhatisthenameofyourorganizationalunit?[Unknown]:hostnameWhatisthename