M2Crypto and general HTTPS help needed

Discussion in 'Python' started by McCann, Brian, Jul 25, 2006.

  1. Hi all. I'm trying to connect to an HTTPS server and fetch a page, and
    I can get that working fine by doing the following:

    >>> from M2Crypto import Rand, SSL, m2urllib
    >>> url = m2urllib.FancyURLopener()
    >>> u = url.open('https://127.0.0.1')
    >>> data = u.read()
    >>> print data
    >>> u.close()


    However, I'm trying to verify that the certificate on the server has the
    right CN on it, to validate that the site really is who it's supposed to
    be. However, for the life of me I can't figure this out. I've read
    through the documentation on M2Crypto (which is cryptic itself), and I
    know I'm still really stupid when it comes to Python, but I figured this
    would be a more obvious thing to do.

    Does anyone know how to do this, or suggest another package to use?

    Thanks!
    --Brian

    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
    Brian McCann
    K12USA.com, Cool Tools for Schools
    1-877-225-0100
    <blocked::mailto:>
    http://www.k12usa.com <http://www.k12usa.com/>
     
    McCann, Brian, Jul 25, 2006
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Camel
    Replies:
    1
    Views:
    1,953
    red floyd
    May 28, 2005
  2. Alan Sheehan
    Replies:
    0
    Views:
    346
    Alan Sheehan
    Jun 10, 2004
  3. Fadly Tabrani
    Replies:
    1
    Views:
    554
    Paul Clinch
    Oct 21, 2004
  4. Gelonida N

    m2crypto https, xmlrpc, keep_alive

    Gelonida N, Aug 2, 2011, in forum: Python
    Replies:
    0
    Views:
    263
    Gelonida N
    Aug 2, 2011
  5. Gelonida N

    m2crypto https, xmlrpc, and cookies

    Gelonida N, Aug 2, 2011, in forum: Python
    Replies:
    0
    Views:
    288
    Gelonida N
    Aug 2, 2011
  6. Gelonida N
    Replies:
    0
    Views:
    357
    Gelonida N
    Aug 2, 2011
  7. Axel
    Replies:
    8
    Views:
    2,080
    Adrienne Boswell
    Apr 27, 2009
  8. jotto
    Replies:
    4
    Views:
    699
    jotto
    Oct 2, 2006
Loading...