Re: Python and SSL



On Apr 16, 10:24 am, "billiejoex" <gne...@xxxxxxxxx> wrote:
Hi,
I developed an ftp-server library and now I would like to add support
for SSL/TLS as described in RFC 2228:http://tools.ietf.org/html/rfc2228
Currenlty I'm searching for documentation about this subject and I
would like to start to ask some questions:

- I noticed that socket module provides an SSL class (socket.ssl) but
even if documentation reports that it does not do any certificate
verification a lot of stdlib modules (imaplib, poplib, smtplib,
httplib and urllib2) provides SSL extension classes wherein socket.ssl
is used. What does it mean?

- On top of that why such extension classes [examples: 1, 2, 3]
accepts key-files and cert-files as optional argouments if no
certificate verification occurs?
[1] poplib.POP3_SSL( host[, port[, keyfile[, certfile]]])
[2] imaplib.IMAP4_SSL( [host[, port[, keyfile[, certfile]]]])
[3] smtplib.starttls( [keyfile[, certfile]])

- By searching through the web I found some daemons supporting SSL
such as this one:http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/442473
By looking at the code I notice that pyopenssl package is used and
that a certificate file is required. Why do I need to use pyopenssl
and how do I generate the cert file?

Could someone point me in the right direction?

Thanks in advance.

I don't know if this will help you or not, but we use the httplib
module's "HTTPSConnection" method to connect with SSL. We use
urlencode from the urllib module to encode the username and password
we send to a server. Since I didn't write this particular bit of code,
I don't completely understand it. But I hope it will give you some
ideas.

Mike

.



Relevant Pages

  • Python and SSL
    ... I developed an ftp-server library and now I would like to add support ... Currenlty I'm searching for documentation about this subject and I ... even if documentation reports that it does not do any certificate ...
    (comp.lang.python)
  • RE: SoapException - NullReferenceException
    ... As for webservice over SSL, there does exists some common issue such as the ... client certificate supplyment(if you've configured it to require client ... Microsoft MSDN Online Support Lead ... I have a web service running on an SSL connection and unfortunately I ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: SSL vs Windows Integrated Security
    ... Actually my understanding is that SSL and integrated auth work on different ... Microsoft Online Community Support ... initial response from the community or a Microsoft Support Engineer within ...
    (microsoft.public.inetserver.iis.security)
  • RE: OWA SSL Redirect Problem
    ... please disable the SSL authentication on the ... Microsoft Online Partner Support ... Business-Critical Phone Support (BCPS) provides you with technical phone ... If you are outside the United States, ...
    (microsoft.public.exchange2000.admin)
  • Re: Python does not play well with others
    ... for SSL in the socket module offers a coherent experience because it ... means that urllib and related modules can offer to support SSL-related ... because the built-in socket module SSL interface ... people started asking him mistakenly why he thought that Python was ...
    (comp.lang.python)