[Twisted-Python] SSL Client Certificate support

Martin Waite martin at datacash.com
Wed Dec 31 12:39:05 EST 2003


On Wed, 2003-12-31 at 17:04, Itamar Shtull-Trauring wrote:
> On Wed, 2003-12-31 at 11:56, Martin Waite wrote:
> 
> > Does twisted support SSL Client certificates ?
> 
> Yep.
> 
> > I can't see anywhere to plug the certificate into 
> > in the SSL ClientContextFactory.
> 
> 
> class MyClientContextFactory:
>     """A context factory for SSL clients."""
> 
>     isClient = 1
>     method = SSL.SSLv3_METHOD
> 
>     def getContext(self):
>         ctx = SSL.Context(self.method)
>         ctx.use_certificate_file(self.certificateFileName)
>         ctx.use_privatekey_file(self.privateKeyFileName)
>         return ctx
> 
> etc.. I suggest reading pyOpenSSL docs for OpenSSL.SSL.Context.
> 

Many thanks - this all works beautifully.

regards,
Martin





More information about the Twisted-Python mailing list