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

SSL Exceptions when using single file binary #59

Closed
krohrsb opened this issue May 16, 2016 · 7 comments
Closed

SSL Exceptions when using single file binary #59

krohrsb opened this issue May 16, 2016 · 7 comments
Assignees
Labels

Comments

@krohrsb
Copy link

krohrsb commented May 16, 2016

$ ntfy -b pushover -o user_key secret_token send 'Pushover test!'
ERROR: Failed to send notification using pushover
Traceback (most recent call last):
  File "/usr/local/bin/ntfy/ntfy/__init__.py", line 34, in notify
    module.notify(message=message, title=title, **backend_config)
  File "/usr/local/bin/ntfy/ntfy/backends/pushover.py", line 107, in notify
    headers={'User-Agent': USER_AGENT})
  File "/usr/local/bin/ntfy/requests/api.py", line 107, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/local/bin/ntfy/requests/api.py", line 53, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/bin/ntfy/requests/sessions.py", line 468, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/bin/ntfy/requests/sessions.py", line 576, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/bin/ntfy/requests/adapters.py", line 447, in send
    raise SSLError(e, request=request)
SSLError: [Errno 20] Not a directory

Where my secret_token is replaced with my actual user token.

Thoughts?

@dschep
Copy link
Owner

dschep commented May 16, 2016

Interesting.. how did you install ntfy? (other useful info potentially: which ntfy & ntfy --version)

@krohrsb
Copy link
Author

krohrsb commented May 16, 2016

I installed it similar to the readme instructions. Only difference I had to put it in /usr/local/bin due to some restrictions I have on my current system.

$ which ntfy & ntfy --version
[1] 57451
/usr/local/bin/ntfy
[1]  + 57451 done       which ntfy
2.0.1

@dschep
Copy link
Owner

dschep commented May 16, 2016

Thanks, I'll check it out when I get a chance (not super easy since I don't own a mac)

@dschep dschep added the bug label May 18, 2016
@dschep dschep changed the title Exception using pushover on osx SSL Exceptions when using single file binary May 18, 2016
@dschep
Copy link
Owner

dschep commented May 18, 2016

Just got a similar report via email from a user on a RaspberyPi. Bad QA on my part, it seems to be an issue with the using requests from the single file binary. The problem presents on Linux too. I'll try get a fix ASAP. For now, please pip install from PyPi:

$ sudo pip install ntfy

@krohrsb
Copy link
Author

krohrsb commented May 20, 2016

Thanks! using sudo pip install ntfy works.

@ghost
Copy link

ghost commented Aug 27, 2016

https://stackoverflow.com/questions/35973137/sslerror-not-a-directory seems to be close to the problem. In theory this should happen on Windows too when using a single exe version ntfy.

@minhoryang
Copy link

minhoryang commented Sep 11, 2016

same error happened

Linux version 4.4.0-36-generic (buildd@lcy01-01) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.2) ) #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016
ntfy --version
2.2.0

Installed:

sudo /usr/bin/easy_install pip
sudo /usr/local/bin/pip psutil

git clone https://github.com/dschep/ntfy.git ntfy.git
pushd ntfy.git
bash zipapp.sh
cp dist/ntfy ~/bin/

Configured:

backends:
    - pushbullet
pushbullet:
    access_token: ......

Failed:

ntfy -l DEBUG done echo

INFO: Starting new HTTPS connection (1): api.pushbullet.com
ERROR: Failed to send notification using pushbullet
Traceback (most recent call last):
  File "/home/minhoryang/bin/ntfy/ntfy/__init__.py", line 65, in notify
    **backend_config)
  File "/home/minhoryang/bin/ntfy/ntfy/backends/pushbullet.py", line 34, in notify
    headers=headers)
  File "/home/minhoryang/bin/ntfy/requests/api.py", line 111, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/home/minhoryang/bin/ntfy/requests/api.py", line 57, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/minhoryang/bin/ntfy/requests/sessions.py", line 475, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/minhoryang/bin/ntfy/requests/sessions.py", line 585, in send
    r = adapter.send(request, **kwargs)
  File "/home/minhoryang/bin/ntfy/requests/adapters.py", line 477, in send
    raise SSLError(e, request=request)
SSLError: [Errno 20] Not a directory

FYI, Bypassed:

REQUESTS_CA_BUNDLE=ntfy.git/build/zipapp/requests/cacert.pem ntfy done echo

and

sudo pip install certifi
ntfy done echo

also worked by http://docs.python-requests.org/en/master/user/advanced/#ca-certificates

@krohrsb krohrsb closed this as completed Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants