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. Advertising

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. Fadly Tabrani
    Replies:
    1
    Views:
    486
    Paul Clinch
    Oct 21, 2004
  2. Gelonida N

    m2crypto https, xmlrpc, keep_alive

    Gelonida N, Aug 2, 2011, in forum: Python
    Replies:
    0
    Views:
    184
    Gelonida N
    Aug 2, 2011
  3. Gelonida N

    m2crypto https, xmlrpc, and cookies

    Gelonida N, Aug 2, 2011, in forum: Python
    Replies:
    0
    Views:
    197
    Gelonida N
    Aug 2, 2011
  4. Gelonida N
    Replies:
    0
    Views:
    270
    Gelonida N
    Aug 2, 2011
  5. jotto
    Replies:
    4
    Views:
    431
    jotto
    Oct 2, 2006
Loading...

Share This Page