We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Как оказалось, модуль requests при отсутствии у сайта сертификата ssl отказывается его открывать.
requests
ssl
У сайта Агидель истек срок ssl-сертификата и приложение перестало его обрабатывать: www.agidel-am.ru/': 'ConnectionError', 'https://www.ya.ru': 200,
ssl-сертификата
www.agidel-am.ru/': 'ConnectionError', 'https://www.ya.ru': 200,
import requests import structlog from fastapi import APIRouter, Depends, Query from requests.exceptions import SSLError from src.api.constants import * from src.api.schemas import DBBackupResponse from src.core.db.user import current_superuser from src.services.db_backup import DBBackupService from src.settings import settings log = structlog.get_logger() test_router = APIRouter() @test_router.get(GET_TEST_URL, description=GET_URL_DESCRIPTION) async def test_get_url( url: str = Query(..., example=settings.CONNECTION_TEST_URL_BASE), ) -> dict[str, int | str] | None: try: status_code = requests.get("https://www.agidel-am.ru/").status_code await log.ainfo("{}".format(GET_URL_DESCRIPTION), status_code=status_code, url=url) return {url: status_code, "time": ANALYTIC_TO_TIME} except SSLError as error: await log.aerror("{}".format(FAILED_GET_URL), error=error, url=url) return {"error": str(error), "time": ANALYTIC_TO_TIME, "url": url}
"""src/api/endpoints/test_router.py"""
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Why?
Как оказалось, модуль
requests
при отсутствии у сайта сертификатаssl
отказывается его открывать.How Does It Work Now?
У сайта Агидель истек срок
ssl-сертификата
и приложение перестало его обрабатывать:www.agidel-am.ru/': 'ConnectionError', 'https://www.ya.ru': 200,
How To Do?
Where?
"""src/api/endpoints/test_router.py"""
The text was updated successfully, but these errors were encountered: