Skip to content

Commit

Permalink
Add pem package in dev group
Browse files Browse the repository at this point in the history
  • Loading branch information
nnsnodnb committed Jan 24, 2024
1 parent b73faa0 commit d4ba932
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
3 changes: 0 additions & 3 deletions kalyke/_types.py

This file was deleted.

13 changes: 5 additions & 8 deletions kalyke/clients/voip.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import httpx
from httpx import AsyncClient

from .._types import CertTypes
from ..models import VoIPApnsConfig
from . import __Client as BaseClient

Expand Down Expand Up @@ -36,13 +35,11 @@ async def send_message(

def _init_client(self, apns_config: VoIPApnsConfig) -> AsyncClient:
headers = apns_config.make_headers()

cert: CertTypes = (
self._get_auth_key_filepath().as_posix(),
self.key_filepath.as_posix() if self.key_filepath is not None else None,
self.password if self.key_filepath is not None else None,
context = httpx.create_ssl_context()
context.load_cert_chain(
certfile=self._get_auth_key_filepath(),
keyfile=self.key_filepath,
password=self.password,
)
context = httpx.create_ssl_context(cert=cert)
context.load_cert_chain(self._get_auth_key_filepath())
client = AsyncClient(headers=headers, verify=context, http2=True)
return client
19 changes: 18 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ pytest-cov = "^4.0.0"
coveralls = "^3.3.1"
pytest-httpx = ">=0.21.3,<0.29.0"
pytest-asyncio = ">=0.20.3,<0.24.0"
pem = "^23.1.0"

[tool.poetry-dynamic-versioning]
enable = true
Expand Down

0 comments on commit d4ba932

Please sign in to comment.