dnorton's blog

HTTPS Client Authentication solution for the Suds SOAP library

We recently came upon the need for a Python SOAP client library that supported SSL client authentication (client-side certificates). When surveying the various options, we liked SOAPpy, but it had a bug in its support for SOAP complex types that required us to switch to Suds, which is also a very nice framework.

Suds does not support client certificates directly, and neither does urllib2, the URL-opener library it depends on. However, httplib, which is used at the core, does support HTTPS client authentication. Fortunately, somebody found a workaround for urllib2, and we were able to combine that with a trick of our own to integrate it with Suds. Here it is:

A dependency injection pattern for mod_python

Dependency Injection is a software design pattern well-known to software engineers, made more popular in recent years by tools such as Spring. I won't try to explain the pattern in it's entirety, but the basic idea is that rather than an object finding dependencies itself (the Service Locator pattern), the object is created by some sort of container and given the dependencies by the container.

Syndicate content