title: How to connect with SSL to HTTPS server in Python 2.7.10+ and make certificate trusted?
body: <p>I wan to connect to https server using ssl with certificate verification and host name validation (do not suggest to switch off verification since it working). How to do it with this code?</p>
  
  <pre><code>import ssl
  import socket
  
  context = ssl.create_default_context()
  context.check_hostname = True
  context.verify_mode = ssl.CERT_REQUIRED
  
  conn = context.wrap_socket(socket.socket(socket.AF_INET),
                             server_hostname='adwords.google.com')
  conn.connect(('adwords.google.com', 443))
  </code></pre>
  
  <p>Instead of connection there is exception:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:/Users/Crezary Wagner/PycharmProjects/learn-adwords/src/03_ssl.py", line 16, in &lt;module&gt;
      conn.connect(('adwords.google.com', 443))
    File "C:\root\Python27\lib\ssl.py", line 844, in connect
      self._real_connect(addr, False)
    File "C:\root\Python27\lib\ssl.py", line 835, in _real_connect
      self.do_handshake()
    File "C:\root\Python27\lib\ssl.py", line 808, in do_handshake
      self._sslobj.do_handshake()
  ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)
  
  Process finished with exit code 1
  </code></pre>
  
  <p>It is clear for me that certificate can not be verified as trusted but how to make this certificate trusted in Python 2.7.10+ and connect?</p>
  
  <p>I want setup it in system not in context if it possible.</p>