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

telegram_bot: verify_ssl configuration doesn't work #23140

Closed
Anonym-tsk opened this issue Apr 16, 2019 · 2 comments · Fixed by #23146
Closed

telegram_bot: verify_ssl configuration doesn't work #23140

Anonym-tsk opened this issue Apr 16, 2019 · 2 comments · Fixed by #23146

Comments

@Anonym-tsk
Copy link
Contributor

Anonym-tsk commented Apr 16, 2019

Home Assistant release with the issue: 0.91.3

Operating environment (Hass.io/Docker/Windows/etc.): Docker

Component/platform: telegram_bot

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

automation:
- alias: Telegram /photo command
  hide_entity: true
  trigger:
    platform: event
    event_type: telegram_command
    event_data:
      command: /photo
  action:
  - service: telegram_bot.send_photo
    data_template:
      target: '{{ trigger.event.data.user_id }}'
      url: !secret hall_cam_url
      verify_ssl: False
      username: !secret xiaomi_camera_user
      password: !secret xiaomi_camera_pass
      authentication: basic
      caption: Hall camera
~

Linked issue: #22067

Traceback (if applicable):

2019-04-16 14:41:48 ERROR (SyncWorker_2) [homeassistant.components.telegram_bot] Can't load data into ByteIO: HTTPSConnectionPool(host='192.168.0.151', port=443): Max retries exceeded with url: /cgi-bin/currentpic.cgi (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))
2019-04-16 14:41:48 ERROR (SyncWorker_2) [homeassistant.components.telegram_bot] Can't send file with kwargs: {'url': 'https://192.168.0.151/cgi-bin/currentpic.cgi', 'verify_ssl': False, 'username': '***', 'password': '***', 'authentication': 'basic', 'caption': 'Hall camera'}

Additional information:
Changing the condition here fixes bug: https://github.com/home-assistant/home-assistant/blob/51508d69ad91c0bca1a7c326841ccf95b8f03fa7/homeassistant/components/telegram_bot/__init__.py#L197
From if verify_ssl: to if verify_ssl is not None:

@cgtobi please comment, it was your review #22069 (review)

@cgtobi
Copy link
Contributor

cgtobi commented Apr 16, 2019

This should be fixed. My review was wrong as stated in the followup comment. I'll submit a PR in a moment.

@cgtobi
Copy link
Contributor

cgtobi commented Apr 16, 2019

Thanks for reporting.

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