title: Flask not using curl auth
body: <p>I'm running an Flask application, using apache with mod_wsgi, with my own ssl certificate (self-signed), i use also the Flask-HTTPAuth lib (<a href="https://flask-httpauth.readthedocs.org/en/latest/" rel="nofollow">https://flask-httpauth.readthedocs.org/en/latest/</a>) and i do use BasicAuth</p>
  
  <pre><code>app.auth = HTTPBasicAuth()
  </code></pre>
  
  <p>I'm trying to test the api with curl but my flask app is not logging me in.</p>
  
  <p>This is the curl line</p>
  
  <pre><code>/usr/bin/curl -H 'Accept: application/json' -H 'Content-type: application/json' -u 'user:mypasswd' --cacert path_to/rootCA.crt --key path_to/backend.key --cert path_to/backend.crt -X POST -d '{}' -vvv https://my_url:443/api/1.0/code/create
  </code></pre>
  
  <p>There is the answer from the server</p>
  
  <pre><code>* Hostname was NOT found in DNS cache
  *   Trying ** ...
  * Connected to ** (**) port 443 (#0)
  * successfully set certificate verify locations:
  *   CAfile: path_to/rootCA.crt
  CApath: /etc/ssl/certs
  * SSLv3, TLS handshake, Client hello (1):
  * SSLv3, TLS handshake, Server hello (2):
  * SSLv3, TLS handshake, CERT (11):
  * SSLv3, TLS handshake, Server key exchange (12):
  * SSLv3, TLS handshake, Server finished (14):
  * SSLv3, TLS handshake, Client key exchange (16):
  * SSLv3, TLS change cipher, Client hello (1):
  * SSLv3, TLS handshake, Finished (20):
  * SSLv3, TLS change cipher, Client hello (1):
  * SSLv3, TLS handshake, Finished (20):
  * SSL connection using ECDHE-RSA-AES256-GCM-SHA384
  * Server certificate:
  *    subject: ***
  *    start date: 2015-10-20 13:22:20 GMT
  *    expire date: 2017-03-03 13:22:20 GMT
  *    common name: *** (matched)
  *    issuer: ***
  *    SSL certificate verify ok.
  * Server auth using Basic with user 'user'
  &gt; POST //api/1.0/code/create HTTP/1.1
  &gt; Authorization: Basic amFtZXM6TDMgbDFuZCEgQHYgczBsMyFM
  &gt; User-Agent: curl/7.35.0
  &gt; Host: ***
  &gt; Accept: application/json
  &gt; Content-type: application/json
  &gt; Content-Length: 83
  &gt;
  * upload completely sent off: 83 out of 83 bytes
  &lt; HTTP/1.1 401 UNAUTHORIZED
  &lt; Date: Wed, 21 Oct 2015 12:29:17 GMT
  * Server Apache/2.4.7 (Ubuntu) is not blacklisted
  &lt; Server: Apache/2.4.7 (Ubuntu)
  * Authentication problem. Ignoring this.
  &lt; WWW-Authenticate: Basic realm="Authentication Required"
  &lt; Content-Length: 19
  &lt; Content-Type: text/html; charset=utf-8
  &lt;
  * Connection #0 to host ***m left intact
  Unauthorized Access
  </code></pre>
  
  <p>There is an Authorization header create by the -u option. but yet in my flask app there is no user or password given.</p>
  
  <pre><code>@app.auth.verify_password
  def verify_password(username, passwd):
    print "USername [%s] [%s]" % (username, passwd)
    return False
  </code></pre>
  
  <p>The ouput given is:</p>
  
  <pre><code>USername [] []
  </code></pre>
  
  <p>So my question is how to give username and password for the verify_password decorator with curl ?</p>
  
  <p>Thank you.</p>