M2Crypto and general HTTPS help needed

2006-07-25 Thread McCann, Brian
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
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]> 
http://www.k12usa.com  

-- 
http://mail.python.org/mailman/listinfo/python-list


RE: What editor shall I use?

2006-02-08 Thread McCann, Brian
I use it on XPvisit http://www.vim.org/download.php , and scroll
down to the Windows section.

--Brian 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] 
> On Behalf Of Lad
> Sent: Wednesday, February 08, 2006 10:08
> To: python-list@python.org
> Subject: Re: What editor shall I use?
> 
> is vim for XP?
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 
> 
-- 
http://mail.python.org/mailman/listinfo/python-list


Need some help with my first Twisted program

2007-10-19 Thread McCann, Brian
I posted this to the Twisted list...figured I'd try here too.

I'm looking for what is probably an simple solution I can't figure out
on my own.  I'm writing an SSH server based on the example on the web
(using conch).  I'm trying to figure out how to detect when the client
exists (for example, when I just close out PuTTY), but I can't get this
to work right.  Looking through the API docs I found "connectionLost()",
which I put in my protocol class (EchoProtocol in the example), but it's
never getting called.  Here's my connectionLost def:

def connectionLost(self,reason):
print "lost:%s" %reason
self.serialServerSocket.close()
self.alive = False
self.serialSocketReadThread.join()

Can someone please tell me what I'm doing wrong?

Thanks,
--Brian
-- 
http://mail.python.org/mailman/listinfo/python-list