Adding parameter 'cert' to `requests.post()` raises `TypeError` exception

Hi

_First & foremost, great module!!!_

I am having an issue when I add `cert` parameter into class method `requests.post()`, because only if I add it does the call raises exception `TypeError`. Without `cert` parameter, `requests.post()` works fine, but I would like to add cert PEM reference.

Here is the calling code, and the filepath to the PEM file is valid:

```
try:
    url = self.__path
    payload = self.__request_json
    headers = {'Content-Type':'application/json', 'charset':'utf-8'}
    certpath = '/usr/local/lib/python3.2/dist-packages/mymodule-0.9.0-py3.2.egg/mymodule/cacert.pem'

    self.__response_object = requests.post( url 
                                            , data=payload 
                                            , headers=headers
                                            , cert=certpath
                                            )
    success = True
except Exception as exc:
    sys.stderr.write("Exception ({})".format(exc))
```

Exception message raised:

```
TypeError (__init__() takes exactly 1 positional argument (2 given))
```

Thank you for your assistance

Jeff in Seattle


I can't reproduce this. I have two questions:
1. What version of Requests are you using?
2. Can you give me a traceback please?


Hi and Happy Holidays
1. Using latest version

certca.pem file attached

code:
            try:
                url = self.__path
                payload = self.__request_json
                headers = {'Content-Type':'application/json',
'charset':'utf-8'}
                certpath = self.whereCert
                print(certpath)
                self.__response_object = requests.post( url
                                                        , data=payload
                                                        , headers=headers
                                                        , cert=certpath
                                                        )
                success = True
            except Exception as exc:
                raise TangoCardSdkException( "Failed to post request:
{0}".format(exc) )
1. traceback:

**\* print_exception:
Traceback (most recent call last):
  File
"/usr/local/lib/python3.2/dist-packages/requests-0.14.2-py3.2.egg/requests/packages/urllib3/connectionpool.py",
line 415, in urlopen
    body=body, headers=headers)
  File
"/usr/local/lib/python3.2/dist-packages/requests-0.14.2-py3.2.egg/requests/packages/urllib3/connectionpool.py",
line 267, in _make_request
    conn.request(method, url, **httplib_request_kw)
ssl.SSLError: [Errno 336265225] _ssl.c:1651: error:140B0009:SSL
routines:SSL_CTX_use_PrivateKey_file:PEM lib

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File
"/usr/local/lib/python3.2/dist-packages/requests-0.14.2-py3.2.egg/requests/models.py",
line 633, in send
    timeout=self.timeout,
  File
"/usr/local/lib/python3.2/dist-packages/requests-0.14.2-py3.2.egg/requests/packages/urllib3/connectionpool.py",
line 446, in urlopen
    raise SSLError(e)
requests.packages.urllib3.exceptions.SSLError: [Errno 336265225]
_ssl.c:1651: error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib

On Sat, Dec 22, 2012 at 2:53 AM, Cory Benfield notifications@github.comwrote:

> I can't reproduce this. I have two questions:
> 1. What version of Requests are you using?
> 2. Can you give me a traceback please?
>    
>    —
>    Reply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/issues/1054#issuecomment-11636035.


Happy Holidays to you too. =)

So, this is not the same exception you posted earlier. This newer exception is being thrown by the deeply unpleasant SSL library.

Out of interest, is your PEM file encrypted? (Put another way, do you have to use a passphrase with it?)


The cacert.pem is not encrypted, see attachment in previous email.

Yes, different exception entirely.

Jeff

On Sat, Dec 22, 2012 at 11:42 AM, Cory Benfield notifications@github.comwrote:

> Happy Holidays to you too. =)
> 
> So, this is not the same exception you posted earlier. This newer
> exception is being thrown by the deeply unpleasant SSL library.
> 
> Out of interest, is your PEM file encrypted? (Put another way, do you have
> to use a passphrase with it?)
> 
> —
> Reply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/issues/1054#issuecomment-11640562.


Ideas on how to resolve the SSL issue?

Thanks

Jeff in Seattle