Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSLError: [Errno 2] No such file or directory #14

Open
speedplane opened this issue Oct 13, 2016 · 0 comments
Open

SSLError: [Errno 2] No such file or directory #14

speedplane opened this issue Oct 13, 2016 · 0 comments

Comments

@speedplane
Copy link
Contributor

I've started getting the following Traceback when sending to Postmark:

Traceback (most recent call last):
  File "../updater\CrossPlatform.py", line 1494, in _send_email_postmark
    resp = pystmark.send(message, api_key = passwords.postmark_apikey)
  File "..\libs\pystmark.py", line 96, in send
    secure=secure, test=test, **request_args)
  File "..\libs\pystmark.py", line 1007, in send
    return self._request(url, data=data, headers=headers, **request_args)
  File "..\libs\pystmark.py", line 891, in _request
    response = requests.request(self.method, url, **kwargs)
  File "..\libs\requests\api.py", line 44, in request
    return session.request(method=method, url=url, **kwargs)
  File "..\libs\requests\sessions.py", line 456, in request
    resp = self.send(prep, **send_kwargs)
  File "..\libs\requests\sessions.py", line 559, in send
    r = adapter.send(request, **kwargs)
  File "..\libs\requests\adapters.py", line 382, in send
    raise SSLError(e, request=request)
SSLError: [Errno 2] No such file or directory

The URL this call is sending to is: https://api.postmarkapp.com/email

The keyword arguments are:

{'data': '{"From": "[email protected]", 
           "To": "mes65@<REDACTED>", 
           "Cc": "michael.sander@<REDACTED>", 
           "HtmlBody": "<p>html_content: test email: function _send_email_postmark at 0x0000000005E8F438.</p>", 
           "Headers": [{"Name": "X-Docket-Alarm", "Value": "Test Email"}], 
           "TrackOpens": true, "Tag": "testing", 
           "TextBody": "text_content: test email: function _send_email_postmark at 0x0000000005E8F438.",
           "Subject": "DA Email Test"}',
 'headers': {'Accept': 'application/json',
             'Content-Type': 'application/json',
           'X-Postmark-Server-Token': '<REDACTED>'}}

I monkey-patched pystmark.py on line 891 adding verify=False to the call to the requests library. That turns off SSL authentication checking, and appears to fix the issue. But ideally, I'd like to be able to use SSL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant