I wonder why I am getting certificate error if I try to access a site with ip address instead of domain name. Lets say for example nslookup
says google.com
is 173.194.43.96
, so I tried to browse https://173.194.43.96 and I got certificate error saying that the security certificate presented by this website was issued for a different website's address. Why is that so?
相关问题
- Mechanize getting “Errno::ECONNRESET: Connection r
- Tomcat and SSL Client certificate
- Can we add four protocols to ServicePointManager.S
- .NET Core gives unknown error while processing HTT
- JDK 11. javax.net.ssl.SSLPeerUnverifiedException:
相关文章
- ssl配置问题
- Intermittent “sslv3 alert handshake failure” under
- Making a two way SSL authentication between apache
- decrypt TLS 1.2 AES-GCM packet
- How to use Jetty with Let's Encrypt certificat
- Sending email using php, gmail, and swiftmailer ca
- Can't pip install packages in python 3.6 due t
- How to disable tls 1.0 and use only tls 1.1 using
On MAC High Sierra and Python 3.6.4, I tried the solution: requests toolbelt:HostHeaderSSLAdapter 1st, unfortunately, it doesn't work for me, then I tried forcediphttpsadapter, got it works finally.
The author explains everything in the readme part and has provided a sample script and it can be followed easily.
1.Install the library by
pip install requests[security] forcediphttpsadapter
2.run the sample script:
Note: For some cases, you may need to remove the prefix: 'www' from the url.
The Common Name is typically composed of Host + Domain Name and will look like
www.yoursite.com
oryoursite.com
. SSL Server Certificates are specific to the Common Name that they have been issued to at the Host level. The Common Name must be the same as the Web address you will be accessing when connecting to a secure site. For example, a SSL Server Certificate for the domaindomain.com
will receive a warning if accessing a site namedwww.domain.com
orsecure.domain.com
, aswww.domain.com
andsecure.domain.com
are different fromdomain.com
.This is because an SSL certificate is issued for a particular domain name. If the certificate name doesn't match the visited domain, the browser will show an error.
One of the main functions of SSL is to prove to the user that they are really connecting to the site they requested, and not to an attacker masquerading as the end site. Without linking the domain name to the certificate this would not be possible.
It is conceivable that the browser certificate system could have been designed to include the IP address in the certificate, but this would make it difficult to use DNS load balancing or even to change hosting providers, as a new certificate would have to be issued each time this happened. If the certificate included just the IP address and not the domain, this would leave the user defenseless against DNS spoofing attacks. So the only way forward really was to use the domain alone.
As a matter of interest, it is possible to obtain an SSL certificate for an IP address - and as Google is their own certificate authority, they could issue themselves a certificate for 173.194.43.96 and thus make it possible to browse google securely by ip address, so long as they used SNI to serve up the correct certificate. It seems implausible that this would be worth the additional complexity however...
This is a nice introduction to SSL if you want to read more:
https://timnash.co.uk/guessing-ssl-questions/
What happens is that the certificate is issued to www.google.com, and not to its IP address. Hence, your browser won't be able to verify the certificate, which lists www.google.com as entity.
For more info, see: www.digicert.com/ssl-support/certificate-name-mismatch-error.htm