title: Python SUDS SOAP request to https service 401
body: <p>I am trying use SUDS and am stuck trying to figure out why I can't get authentication to work (or https).</p>
  
  <p>The service I am trying to access is over https with basic digest authentication.  Based on the debugs it seems to be using http instead of https.  But not really sure what I am missing.  Any clue is appreciated.</p>
  
  <pre><code>from suds.client import Client
  from suds.transport.http import HttpAuthenticated
  import logging
  logging.basicConfig(level=logging.DEBUG)
  logging.getLogger('suds.client').setLevel(logging.DEBUG)
  logging.getLogger('suds.transport').setLevel(logging.DEBUG)
  logging.getLogger('suds.xsd.schema').setLevel(logging.DEBUG)
  logging.getLogger('suds.wsdl').setLevel(logging.DEBUG)
  
  def main():
      url = 'https://blah.com/soap/sp/Services?wsdl'
      credentials = dict(username='xxxx', password='xxxx')
      t = HttpAuthenticated(**credentials)
      client = Client(url, location='https://blah.com/soap/sp/Services', transport=t)
      print client.last_sent()
  
  if __name__=="__main__":
      main()
  </code></pre>
  
  <p>Debug Output:</p>
  
  <blockquote>
    <p>DEBUG:suds.wsdl:reading wsdl at: <a href="https://blah.com/soap/sp/Services?wsdl" rel="nofollow">https://blah.com/soap/sp/Services?wsdl</a> ...
    DEBUG:suds.transport.http:opening (https://blah.com/soap/sp/Services?wsdl)
    <br/>snip ...<br/>
     File "C:\Python27\Lib\site-packages\suds-0.4-py2.7\suds\reader.py", line 95, in download<br/>
      fp = self.options.transport.open(Request(url))</p>
    
    <p>File "C:\Python27\Lib\site-packages\suds-0.4-py2.7\suds\transport\http.py", line 173, in open<br/>
        return HttpTransport.open(self, request)</p>
    
    <p>File "C:\Python27\Lib\site-packages\suds-0.4-py2.7\suds\transport\http.py", line 64, in open<br/>raise TransportError(str(e), e.code, e.fp)</p>
    
    <p>suds.transport.TransportError: HTTP Error 401: Authorization Required</p>
  </blockquote>